using LYFZ.BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace LYFZ.Software.MainBusiness.FinancialManagement
{
public class frmWageStatisticsViewList : LYFZ.Software.UI.FinancialManagement.frmWageStatisticsViewList
{
public frmWageStatisticsViewList() {
this.Load += frmWageStatisticsViewList_Load;
this.btnClosed.Click += btnClosed_Click;
this.btnQuery.Click += btnQuery_Click;
this.btnExport.Click += btnExport_Click;
this.cmbItemCategory.SelectedIndexChanged += cmbItemCategory_SelectedIndexChanged;
this.dgvStatisticsList.EraseCell = true;
}
void cmbItemCategory_SelectedIndexChanged(object sender, EventArgs e)
{
BindUserWageStatisticsPerformanceCommissionList(this.cmbItemCategory.SelectedIndex);
}
///
/// 导出
///
///
///
void btnExport_Click(object sender, EventArgs e)
{
this.dgvStatisticsList.ExportDataTable();
}
///
/// 开始时间
///
public DateTime StartDateTime;
///
/// 结束时间
///
public DateTime EndDateTime;
///
/// 绑定业绩明细
///
///
void BindUserWageStatisticsPerformanceCommissionList(int WSQueryItem)
{
DataGridViewRow dgRow = null;
this.dgvStatisticsList.Rows.Clear();
foreach (UserWageStatisticsPerformanceCommission userWSPC in this.UserWageStatisticsPerformanceCommissionList)
{
dgRow = new DataGridViewRow();
dgRow.CreateCells(this.dgvStatisticsList);
SetDataGridViewRowCellStyle(dgRow, Color.LightCyan,fStyle:FontStyle.Bold,size:12f);
dgRow.Cells[0].Value = userWSPC.User_DividedShopName;
dgRow.Cells[1].Value = userWSPC.Dt_Name;
dgRow.Cells[2].Value = userWSPC.User_Name;
dgRow.Cells[3].Value = userWSPC.BasicWage;//基本工资
dgRow.Cells[4].Value = userWSPC.Bonus;//奖金
dgRow.Cells[5].Value = userWSPC.FineMoney;//罚金
dgRow.Cells[7].Value = "合计";
dgRow.Cells[8].Value = "";
userWSPC.SumComputePerformanceCommission(WSQueryItem);
dgRow.Cells[9].Value = "";
dgRow.Cells[10].Value = GetToDecimal(userWSPC.SumPerformance);//总业绩
dgRow.Cells[11].Value = GetToDecimal(userWSPC.SumCommission);//总提成金额;
//总工资=基本工资+奖金+(-罚金)+总提成金额
dgRow.Cells[6].Value = GetToDecimal(userWSPC.BasicWage + userWSPC.Bonus + userWSPC.FineMoney + userWSPC.SumCommission);
this.dgvStatisticsList.Rows.Add(dgRow);
for (int i = 0; i < userWSPC.PerformanceCommissionList.Count; i++)
{
PerformanceCommissionInfo pcInfo = userWSPC.PerformanceCommissionList[i];
if (WSQueryItem == 0 || pcInfo.WageQueryProgram.WQC_StatisticalItems == WSQueryItem)
{
bool isEndRow = false;
if (i == userWSPC.PerformanceCommissionList.Count - 1)
{
isEndRow = true;
}
if (pcInfo.WageDataRowObjList.Count > 0)
{
this.dgvStatisticsList.Rows.Add(GetSubDataGridViewRow(pcInfo, null, false, true));
}
for (int j = 0; j < pcInfo.WageDataRowObjList.Count; j++)
{
WageDataRowObj wageRowObj = pcInfo.WageDataRowObjList[j];
if (j == pcInfo.WageDataRowObjList.Count - 1&&isEndRow)
{
this.dgvStatisticsList.Rows.Add(GetSubDataGridViewRow(pcInfo, wageRowObj,true));
}
else
{
this.dgvStatisticsList.Rows.Add(GetSubDataGridViewRow(pcInfo, wageRowObj));
}
}
}
}
}
// MessageBoxCustom.Show(WSQueryItem.ToString());
}
///
///
///
/// 统计查询方案
///
///
///
DataGridViewRow GetSubDataGridViewRow(PerformanceCommissionInfo pcInfo, WageDataRowObj wageRowObj, bool isEndRow = false, bool isSumRow = false)
{
LYFZ.Model.WageStatisticsQueryItem wItem = (LYFZ.Model.WageStatisticsQueryItem)Convert.ToInt32(pcInfo.WageQueryProgram.WQC_StatisticalItems);
DataGridViewRow dgRow = new DataGridViewRow();
dgRow.CreateCells(this.dgvStatisticsList);
SetDataGridViewRowCellStyle(dgRow, Color.White);
if (isEndRow)
{
dgRow.Cells[0].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[1].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[2].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[3].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[4].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[5].Tag = this.dgvStatisticsList.EraseCellDrawLineHEnd;
dgRow.Cells[6].Tag = this.dgvStatisticsList.EraseCellDrawLineVHEnd;
}
else
{
dgRow.Cells[0].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[1].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[2].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[3].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[4].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[5].Tag = this.dgvStatisticsList.EraseCellDrawLine;
dgRow.Cells[6].Tag = this.dgvStatisticsList.EraseCellDrawLineVEnd;
}
if (isSumRow)
{
SetDataGridViewRowCellStyle(dgRow, Color.LightCoral,bgStarIndex: 7,fStyle:FontStyle.Bold);
dgRow.Tag = "FontStyle.Bold";
dgRow.Cells[7].Value = "小计";
// dgRow.Cells[8].Value = "【" + wItem.ToString() + "】" + pcInfo.WageQueryProgram.WQC_QueryName;
dgRow.Cells[9].Value = "";
dgRow.Cells[10].Value = GetToDecimal(pcInfo.Performance);
dgRow.Cells[11].Value = GetToDecimal(pcInfo.Commission);
}
else
{
dgRow.Cells[7].Value = wItem.ToString();
dgRow.Cells[8].Value = pcInfo.WageQueryProgram.WQC_QueryName;
try
{
dgRow.Cells[9].Value = wageRowObj.ResponsiblePosition;//
dgRow.Cells[10].Value = GetToDecimal(wageRowObj.CurrentPerformance);//业绩
if (wItem == Model.WageStatisticsQueryItem.计件提成)
{
dgRow.Cells[11].Value = GetToDecimal(wageRowObj.CurrentPerformance);
}
else {
dgRow.Cells[11].Value = "";
}
//明细内容
switch (wItem)
{
case Model.WageStatisticsQueryItem.订单前期:
case Model.WageStatisticsQueryItem.订单后期:
case Model.WageStatisticsQueryItem.服务前期:
case Model.WageStatisticsQueryItem.服务后期:
//订单类型 0:为婚纱套系 1:为成长套系 2:为写真套系 3:服务套系 4:婚庆套系
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = GetToDecimal(wageRowObj.ReceiptRow["PaidAmount"]);
dgRow.Cells[13].Value = GetRowValueToString(wageRowObj.ReceiptRow["Pay_Category"]);
dgRow.Cells[14].Value =GetsCollectionCategoryType(wItem,wageRowObj.ReceiptRow["Pay_TwoPinsCategory"]);
dgRow.Cells[15 + 1].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Pay_PaymentMethod"]);
dgRow.Cells[16 + 1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Pay_OpenSingle"])); ;
dgRow.Cells[17 + 1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Pay_CreateDatetime"]);
}
if (wageRowObj.OrderCustomer != null)
{
string orderNumber = GetRowValueToString(wageRowObj.OrderCustomer["Ord_SinceOrderNumber"]);
if (String.IsNullOrEmpty(orderNumber))
{
orderNumber = GetRowValueToString(wageRowObj.OrderCustomer["Ord_Number"]);
}
dgRow.Cells[18+1].Value = orderNumber;
dgRow.Cells[19+1].Value = GetRowValueToString(wageRowObj.OrderCustomer["Cus_Name"]);
dgRow.Cells[20+1].Value = ((EnumPublic.OrderType)Convert.ToInt32(wageRowObj.OrderCustomer["Ord_Type"].ToString())).ToString();
dgRow.Cells[21+1].Value = GetRowValueToString(wageRowObj.OrderCustomer["Ord_SeriesName"]);
dgRow.Cells[22+1].Value = GetToDecimal(wageRowObj.OrderCustomer["Ord_SeriesPrice"]);
dgRow.Cells[23+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ord_CreateDateTime"]);
dgRow.Cells[24+1].Value = GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_Sights"]);
dgRow.Cells[25+1].Value = GetPhotographyStatus(wageRowObj.OrderCustomer["PhotographyStatus"], GetDateTimeString(wageRowObj.OrderCustomer["Ordpg_PhotographyTime"]));
dgRow.Cells[26+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ordpg_PhotographyTime"]);
dgRow.Cells[27+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_Photographer"]));
dgRow.Cells[28+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_PhotographyAssistant"]));
dgRow.Cells[29+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_MakeupArtist"]));
dgRow.Cells[30+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_MakeupAssistant"]));
dgRow.Cells[31+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_BootDivision"]));
dgRow.Cells[32+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordpg_BootDivisionAssistant"]));
dgRow.Cells[33+1].Value = GetProcessStatus(wageRowObj.OrderCustomer["ordv_EarlyRepairStatus"], "初修");
dgRow.Cells[34+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordv_EarlyRepairName"]));
dgRow.Cells[35+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ordv_EarlyRepairTime"]);
dgRow.Cells[36+1].Value = GetProcessFilmSelectionStatus(wageRowObj.OrderCustomer["Ordv_FilmSelectionStatus"]);
dgRow.Cells[37+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordv_FilmSelectionName"]));
dgRow.Cells[38+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ordv_FilmSelectionTime"]);
dgRow.Cells[39+1].Value = GetProcessStatus(wageRowObj.OrderCustomer["Ordv_RefinementStatus"], "精修");
dgRow.Cells[40+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordv_RefinementName"]));
dgRow.Cells[41+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ordv_RefinementTime"]);
dgRow.Cells[42+1].Value = GetProcessStatus(wageRowObj.OrderCustomer["Ordv_DesignerStatus"], "设计");
dgRow.Cells[43+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.OrderCustomer["Ordv_DesignerName"]));
dgRow.Cells[44+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["Ordv_DesignerTime"]);
dgRow.Cells[45+1].Value = GetRowValueToString(wageRowObj.OrderCustomer["PickupStatus"]);
dgRow.Cells[46+1].Value = GetDateTimeString(wageRowObj.OrderCustomer["OPlist_PickupTime"]);
dgRow.Cells[47 + 1].Value = WageStatisticsSatisfactionScore(wageRowObj.SatisfactionScore);
}
break;
case Model.WageStatisticsQueryItem.散客消费:
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = GetToDecimal(wageRowObj.ReceiptRow["PaidAmount"]);
dgRow.Cells[13].Value = GetRowValueToString(wageRowObj.ReceiptRow["Pay_Category"]);//收款类型
dgRow.Cells[14].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Tsorder_Category"]);//销售类别
dgRow.Cells[15+1].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Pay_PaymentMethod"]);
dgRow.Cells[16+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Pay_OpenSingle"]));
dgRow.Cells[17+1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Pay_CreateDatetime"]);
dgRow.Cells[18+1].Value = wageRowObj.ReceiptRow["Tsorder_Number"].ToString();
dgRow.Cells[19+1].Value = wageRowObj.ReceiptRow["Cus_Name"].ToString();
dgRow.Cells[20+1].Value = wItem.ToString();
dgRow.Cells[21+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Tsorder_Name"]);
dgRow.Cells[22+1].Value = GetToDecimal(wageRowObj.ReceiptRow["Tsorder_Money"]);
dgRow.Cells[23 + 1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Tsorder_CreateDatetime"]);
}
break;
case Model.WageStatisticsQueryItem.计件提成:
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = "";//GetToDecimal(wageRowObj.ReceiptRow["sum_Percentage"]);
dgRow.Cells[13].Value = wItem.ToString();//收款类型
dgRow.Cells[14].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Pcr_CompletionContents"]);//销售类别 工作内容
dgRow.Cells[15].Value =wageRowObj.ReceiptRow["Pcr_Quantity"].ToString();
dgRow.Cells[15+1].Value = GetPcr_Type(wageRowObj.ReceiptRow["Pcr_Type"]);
dgRow.Cells[16+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Pcr_DigitalDivision"]));
dgRow.Cells[17+1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Pcr_Date"]);
dgRow.Cells[18 + 1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Pcr_OrderNumber"]);
}
if (wageRowObj.OrderCustomer != null)
{
dgRow.Cells[18 + 1].Value = GetRowValueToString(wageRowObj.OrderCustomer["订单号"]);
dgRow.Cells[19 + 1].Value = GetRowValueToString(wageRowObj.OrderCustomer["客户姓名"]);
string orderTypeString = GetRowValueToString(wageRowObj.OrderCustomer["订单类型"]);
if (orderTypeString.Trim().Length > 0 && orderTypeString != "散客消费")
{
dgRow.Cells[20 + 1].Value = Enum.ToObject(typeof(LYFZ.EnumPublic.OrderType), Convert.ToInt32(orderTypeString)).ToString();
}
else
{
dgRow.Cells[20 + 1].Value = orderTypeString;
}
dgRow.Cells[21 + 1].Value = GetRowValueToString(wageRowObj.OrderCustomer["套系名称"]);
dgRow.Cells[22 + 1].Value = GetRowValueToString(wageRowObj.OrderCustomer["套系价格"]);
dgRow.Cells[23 + 1].Value = GetDateTimeString(wageRowObj.OrderCustomer["录入日期"]);
}
break;
case Model.WageStatisticsQueryItem.礼服租售:
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = GetToDecimal(wageRowObj.ReceiptRow["PaidAmount"]);
dgRow.Cells[13].Value = "礼服租售收款";//收款类型
dgRow.Cells[14].Value = GetRowValueToString(wageRowObj.ReceiptRow["Pay_ReceivableProject"]);//销售类别
dgRow.Cells[15+1].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Pay_PaymentMethod"]);
dgRow.Cells[16+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Pay_OpenSingle"]));
dgRow.Cells[17+1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Pay_CreateDatetime"]);
dgRow.Cells[18+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Dsro_Number"]);
dgRow.Cells[19+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Cus_Name"]);
dgRow.Cells[20+1].Value = wItem.ToString();
dgRow.Cells[21+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Pay_ReceivableProject"]);
dgRow.Cells[22+1].Value = GetToDecimal(wageRowObj.ReceiptRow["Dsro_Amount"]);
dgRow.Cells[23 + 1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Dsro_CreateDateTime"]);
}
break;
case Model.WageStatisticsQueryItem.会员充值:
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = GetToDecimal(wageRowObj.ReceiptRow["Mcrr_RechargeAmount"]);
dgRow.Cells[13].Value = "会员充值收款";//收款类型
dgRow.Cells[14].Value = GetRowValueToString(wageRowObj.ReceiptRow["Mcrr_RechargeName"]);//销售类别
dgRow.Cells[15+1].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Mcrr_PaymentMethod"]);
dgRow.Cells[16+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Mcrr_OrderPerson"]));
dgRow.Cells[17+1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Mcrr_CreateDatetime"]);
dgRow.Cells[18+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Mcrr_RechargeNumber"]);
dgRow.Cells[19+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Cus_Name"]) + "【" + GetRowValueToString(wageRowObj.ReceiptRow["Mc_CradNumber"]) + "】";
dgRow.Cells[20+1].Value = wItem.ToString();
dgRow.Cells[21+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Mcrr_RechargeName"]);
dgRow.Cells[22+1].Value = GetToDecimal(wageRowObj.ReceiptRow["Mcrr_RechargeAmount"]);
dgRow.Cells[23 + 1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Mcrr_CreateDatetime"]);
}
break;
case Model.WageStatisticsQueryItem.服务卡充值:
if (wageRowObj.ReceiptRow != null)
{
dgRow.Cells[12].Value = GetToDecimal(wageRowObj.ReceiptRow["Mcpt_PaymentAmount"]);
dgRow.Cells[13].Value = "会员服务卡充值收款";//收款类型
dgRow.Cells[14].Value = GetRowValueToString(wageRowObj.ReceiptRow["Mcpt_PaymentType"]);//销售类别
dgRow.Cells[15+1].Value = GetClassCodeToCalssName(wageRowObj.ReceiptRow["Mcpt_PaymentMethod"]);
dgRow.Cells[16+1].Value = GetUserIDToUserName(GetRowValueToString(wageRowObj.ReceiptRow["Mcpt_OrderPerson"]));
dgRow.Cells[17+1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Mcpt_CreateDatetime"]);
dgRow.Cells[18+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Mcpt_PaymentNumber"]);
dgRow.Cells[19+1].Value = GetRowValueToString(wageRowObj.ReceiptRow["Cus_Name"]) + "【" + GetRowValueToString(wageRowObj.ReceiptRow["Mc_CradNumber"]) + "】";
dgRow.Cells[20+1].Value = wItem.ToString();
dgRow.Cells[21+1].Value = "会员服务卡充值";
dgRow.Cells[22+1].Value = GetToDecimal(wageRowObj.ReceiptRow["Mcpt_PaymentAmount"]);
dgRow.Cells[23 + 1].Value = GetDateTimeString(wageRowObj.ReceiptRow["Mcpt_CreateDatetime"]);
}
break;
}
}
catch (Exception ex){
MessageBoxCustom.Show(ex.Message);
this.Close();
}
}
return dgRow;
}
string GetPcr_Type(object obj)
{
int type = 0;
//类别(0:直接录入、1:预约服务录入、2:拍照导片录入、3:初修导片录入、4:设计导片录入)
if (obj != null && obj.ToString().Trim().Length > 0)
{
type = Convert.ToInt32(obj.ToString());
}
switch (type)
{
case 0:return "直接录入";
case 1: return "预约服务录入";
case 2: return "拍照导片录入";
case 3: return "初修导片录入";
case 4: return "设计导片录入";
}
return "直接录入";
}
///
/// 收款类型
///
///
///
string GetsCollectionCategoryType(Model.WageStatisticsQueryItem witem,object obj)
{
string rettype = "未知";
switch (witem)
{
case Model.WageStatisticsQueryItem.订单前期:
rettype = "订单前期收款";
break;
case Model.WageStatisticsQueryItem.订单后期:
case Model.WageStatisticsQueryItem.服务前期:
case Model.WageStatisticsQueryItem.服务后期:
rettype = GetClassCodeToCalssName(obj);
break;
}
return rettype;
}
string GetClassCodeToCalssName(object obj)
{
if (obj != null && obj.ToString().Length>0)
{
return LYFZ.BLL.WageStatisticsProcess.GetClassCodeToCalssName(obj.ToString());
}
return "";
}
string WageStatisticsSatisfactionScore(DataRow row)
{
if (row != null&&row["sumScores"]!=null)
{
return row["sumScores"].ToString();
}
return "";
}
string GetProcessFilmSelectionStatus(object obj)
{
if (obj != null)
{
if (obj.ToString() == "1")
{
return "选片OK";
}
}
return "未选";
}
///
/// 获取流程状态
///
///
///
string GetProcessStatus(object obj,string text="初修")
{
if (obj != null)
{
if (obj.ToString() == "2")
{
return text+"OK";
}
else if (obj.ToString() == "1")
{
return text + "中";
}
}
return "未"+text;
}
///
/// 获取拍照状态
///
///
///
///
string GetPhotographyStatus(object status, string time)
{
if (status != null && status.ToString() == "1")
{
return "拍照OK";
}
else if (time.Trim().Length > 1)
{
return "拍照中";
}
else {
return "未拍";
}
}
///
/// 获取字符串类型的值
///
///
///
string GetRowValueToString(object obj)
{
if (obj != null)
{
return obj.ToString();
}
return "";
}
///
/// 根据用户ID获取用户名
///
///
///
string GetUserIDToUserName(string userIDs)
{
return LYFZ.DAL.DAL_ErpUser.GetUserIDToUserName(userIDs);
//string retUserNames = "";
//string[] tempIDs = userIDs.Trim(',').Split(',');
//foreach (string uid in tempIDs)
//{
// if (!string.IsNullOrEmpty(uid))
// {
// foreach (DataRow user in LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows)
// {
// string tempUserName = user["User_Name"].ToString().Trim() + "/";
// if (user["User_EmployeeID"].ToString().ToLower().Trim() == uid.Trim().ToLower() && !retUserNames.Contains(tempUserName))
// {
// retUserNames += tempUserName;
// break;
// }
// }
// }
//}
//return retUserNames.Trim('/');
}
string GetToDecimal(object number)
{
if (number != null && number.ToString().Trim().Length > 0)
{
return Convert.ToDecimal(number).ToString("n2");
}
return "0";
}
string GetDateTimeString(object time)
{
if (time != null && time.ToString().Trim().Length>0)
{
return Convert.ToDateTime(time.ToString()).ToString("yyyy-MM-dd HH:mm");
}
return "";
}
///
/// 设置行样式
///
///
///
///
///
///
void SetDataGridViewRowCellStyle(DataGridViewRow row, System.Drawing.Color bgcolor,int bgStarIndex=0, System.Drawing.FontStyle fStyle= System.Drawing.FontStyle.Regular,float size=10.5f,System.Windows.Forms.DataGridViewContentAlignment alignment = DataGridViewContentAlignment.MiddleCenter)
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
dataGridViewCellStyle2.Alignment = alignment;
dataGridViewCellStyle2.BackColor = bgcolor;//System.Drawing.Color.FromArgb(((int)(((byte)(43)))), ((int)(((byte)(108)))), ((int)(((byte)(150)))));
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", size, fStyle, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
for (int i = 0; i < row.Cells.Count;i++ )
{
if (i >= bgStarIndex)
{
DataGridViewCell cell = row.Cells[i];
cell.Style = dataGridViewCellStyle2;
}
}
}
void btnQuery_Click(object sender, EventArgs e)
{
}
void btnClosed_Click(object sender, EventArgs e)
{
this.Close();
}
List _UserWageStatisticsPerformanceCommissionList = new List();
///
/// 用户工资计算结果集合
///
public List UserWageStatisticsPerformanceCommissionList
{
get { return _UserWageStatisticsPerformanceCommissionList; }
set { _UserWageStatisticsPerformanceCommissionList = value; }
}
void frmWageStatisticsViewList_Load(object sender, EventArgs e)
{
this.btnExport.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.DataExport);
this.dgvStatisticsList.Columns[0].Visible = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition;
// 部门人员绑定
LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbEmployeeName, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false, IsShowAdmin: true, tb_User: LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable);
BindItemCategory();
}
///
/// 绑定统计项目
///
void BindItemCategory()
{
this.cmbItemCategory.Items.Clear();
this.cmbItemCategory.Items.Add("所有项目");
string[] WageStatisticsQueryItems = Enum.GetNames(typeof(LYFZ.Model.WageStatisticsQueryItem));
foreach (string qItem in WageStatisticsQueryItems)
{
this.cmbItemCategory.Items.Add(qItem);
}
this.cmbItemCategory.SelectedIndex = 0;
}
}
/* ///
/// 工资统计明细表字段名
///
enum PDFieldName
{
所属门店,
所属部门,
员工姓名,
基本工资,
奖金,
罚金,
合计总工资,
统计项目,
统计名称,
岗位职责,
业绩,
提成金额,
收款金额,
收款类型,
销售类别,
支付方式,
接单人,
收款时间,
订单号,
客户名称,
订单类型,
订单套系名称,
订单金额,
订单时间,
拍摄名称,
拍摄状态,
拍摄时间,
摄影师,
摄影助理,
化妆师,
化妆助理,
引导师,
引导助理,
初修状态,
初修师,
初修时间,
选片状态,
选片师,
选片时间,
精修状态,
精修时间,
精修师,
设计状态,
设计时间,
设计师,
取件状态,
取件时间,
满意度分值
}*/
}