123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using LYFZ.BLL;
- using System.Collections;
- namespace LYFZ.Software.MainBusiness.FinancialManagement
- {
- public partial class frmWageStatisticsQuery : LYFZ.Software.UI.FinancialManagement.frmWageStatisticsQuery
- {
- public frmWageStatisticsQuery()
- {
- this.btntest.Click += btntest_Click;
- this.Shown += frmWageStatisticsQuery_Shown;
- // this.cmbEmployeeName.ComboBoxTree_NodeMouseClick+=cmbEmployeeName_ComboBoxTree_NodeMouseClick;
- this.Load += frmWageStatisticsQuery_Load;
- this.btnClosed.Click += bntClosed_Click;
- this.btnQuery.Click += btnQuery_Click;
- this.btnExport.Click += btnExport_Click;
- this.txtTimeStart.ValueChanged += txtTimeStart_ValueChanged;
- this.txtTimeEnd.ValueChanged += txtTimeEnd_ValueChanged;
- this.dgvStatisticsList.EraseCell = true;
- this.btnProgramSetting.Click += btnProgramSetting_Click;
- this.dgvStatisticsList.CellDoubleClick += dgvStatisticsList_CellDoubleClick;
- this.btnDataStatisticsQuery.Click += btnDataStatisticsQuery_Click;
- this.cbxStoreList.SelectedIndexChanged += cbxStoreList_SelectedIndexChanged;
- this.btnViews.Click += btnViews_Click;
- }
-
- /// <summary>
- /// 查看详细
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnViews_Click(object sender, EventArgs e)
- {
- frmWageStatisticsViewList frmWSViewList = new frmWageStatisticsViewList();
- frmWSViewList.StartDateTime = this.StartDateTime;
- frmWSViewList.EndDateTime = this.EndDateTime;
- frmWSViewList.UserWageStatisticsPerformanceCommissionList.AddRange(this.UserWageStatisticsPerformanceCommissionList.ToArray());
- frmWSViewList.Show();
- }
- /// <summary>
- /// 导出
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnExport_Click(object sender, EventArgs e)
- {
- this.dgvStatisticsList.ExportDataTable();
- }
- void cbxStoreList_SelectedIndexChanged(object sender, EventArgs e)
- {
- RefreshDataStatisticsQuery();
- }
- /// <summary>
- /// 工资统计处理类
- /// </summary>
- WageStatisticsProcess WSP_WageStatisticsProcess = new WageStatisticsProcess();
- /// <summary>
- /// 订单信息总订单数统计处理类
- /// </summary>
- WageStatisticsOrderInfo WSO_WageStatisticsOrderInfo = new WageStatisticsOrderInfo();
- /// <summary>
- /// 订单信息当前阶段订单数统计处理类
- /// </summary>
- WageStatisticsOrderInfo WSO_WageStatisticsCurrentOrderInfo = new WageStatisticsOrderInfo();
- string WageStatisticsInfo = "";
- /// <summary>
- /// 加载工资统计基础数据
- /// </summary>
- void LoadBasisWageStatisticsDataTable(BackgroundWorker backgroundWorker)
- {
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.WageStatisticsOrderTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.RelatedOrderCount);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.CurrentRelatedOrderCount);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.WageStatisticsOrderReceiptRecordTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.WageStatisticsSatisfactionScoreTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.DressRentalRecordsTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.OtherConsumptionRecordTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.PieceCommissionRecordTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.MemberCardRechargeRecordTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.MemberCardPaymentRecordTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.AttractionsLevelStatisticsTable);
- WageStatisticsProcess.DisposeTable(WSP_WageStatisticsProcess.AttractionsPersonnelStatisticsTable);
- System.GC.Collect();
- LYFZ.BLL.BLL_ErpWageCommissionSet.UpdateCommissionSet();
- LYFZ.BLL.BLL_ErpCommissionPercentage.LoadCommissionPercentageTable();
-
- backgroundWorker.ReportProgress(0, "正获取订单信息...");
- this.WSP_WageStatisticsProcess.WageStatisticsOrderTable = WageStatisticsProcess.GetPROCE_WageStatisticsOrder(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正统计本次相关订单数...");
- this.WSP_WageStatisticsProcess.RelatedOrderCount = WageStatisticsProcess.GetRelatedOrderCount(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正统计本次新订单数...");
- this.WSP_WageStatisticsProcess.CurrentRelatedOrderCount = WageStatisticsProcess.GetCurrentRelatedOrderCount(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取订单收款记录...");
- this.WSP_WageStatisticsProcess.WageStatisticsOrderReceiptRecordTable = WageStatisticsProcess.GetPROCE_WageStatisticsOrderReceiptRecord(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- if (this.chkSatisfaction.Checked)
- {
- backgroundWorker.ReportProgress(0, "正获取订单满意度分值...");
- this.WSP_WageStatisticsProcess.WageStatisticsSatisfactionScoreTable = WageStatisticsProcess.GetPROCE_WageStatisticsSatisfactionScore(this.StartDateTime, this.EndDateTime);
- }
- backgroundWorker.ReportProgress(0, "正获取礼服租售记录...");
- this.WSP_WageStatisticsProcess.DressRentalRecordsTable = WageStatisticsProcess.GetDressRentalRecords(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取其它销费记录...");
- this.WSP_WageStatisticsProcess.OtherConsumptionRecordTable = WageStatisticsProcess.GetOtherConsumptionRecords(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取计件提成记录...");
- this.WSP_WageStatisticsProcess.PieceCommissionRecordTable = WageStatisticsProcess.GetPieceCommissionRecords(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取计件提成订单记录...");
- this.WSP_WageStatisticsProcess.PieceCommissionRecordOrderList = WageStatisticsProcess.GetPieceCommissionRecordOrderList(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取会员卡充值记录...");
- this.WSP_WageStatisticsProcess.MemberCardRechargeRecordTable = WageStatisticsProcess.GetMemberCardRechargeRecord(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取会员服务卡收款...");
- this.WSP_WageStatisticsProcess.MemberCardPaymentRecordTable = WageStatisticsProcess.GetMemberCardPaymentRecord(this.StartDateTime, this.EndDateTime, this.CurrentQueryStoreList);
- backgroundWorker.ReportProgress(0, "正获取景点和阶段人员信息...");
- this.WSP_WageStatisticsProcess.AttractionsLevelStatisticsTable = WageStatisticsProcess.GetAttractionsLevelStatistics(this.StartDateTime, this.EndDateTime);
- backgroundWorker.ReportProgress(0, "正获取景点和阶段等级信息...");
- this.WSP_WageStatisticsProcess.AttractionsPersonnelStatisticsTable = WageStatisticsProcess.GetAttractionsPersonnelStatistics(this.StartDateTime, this.EndDateTime);
- }
- /// <summary>
- /// 要统计的基础数据是否已统计加载
- /// </summary>
- bool isDataStatisticsQuery = false;
- string DataStatisticsQueryTimestamp = "";
- string GetDataStatisticsQueryTimestamp()
- {
- return this.StartDateTime.ToString("yyyy-MM-dd") + this.EndDateTime.AddDays(1).ToString("yyyy-MM-dd") + this.CurrentQueryStoreList.QueryType.ToString() + WageStatisticsProcess.GetQueryStoreList(this.CurrentQueryStoreList);
- }
- /// <summary>
- /// 刷新基础数据加载状态 标记是否需要重新加载基础数据
- /// </summary>
- void RefreshDataStatisticsQuery()
- {
- GetCurrentQueryStoreList();
- GetTimePeriod();
- string newDataStatisticsQueryTimestamp = GetDataStatisticsQueryTimestamp();
- if (string.IsNullOrEmpty(DataStatisticsQueryTimestamp))
- {
- isDataStatisticsQuery = false;
- }
- else {
- if (DataStatisticsQueryTimestamp.Trim().ToLower() != newDataStatisticsQueryTimestamp.Trim().ToLower())
- {
- isDataStatisticsQuery = false;
- }
- else {
- isDataStatisticsQuery = true;
- }
- }
- this.lbDataStatisticsQueryInfo.ForeColor = Color.Teal;
- if (!isDataStatisticsQuery)
- {
- this.lbDataStatisticsQueryInfo.ForeColor = Color.Red;
- if (this.WSP_WageStatisticsProcess.DressRentalRecordsTable == null)
- {
- this.lbDataStatisticsQueryInfo.Text = "未统计数据";
- }
- else
- {
- if (IsStoreNode(this.cmbEmployeeName.TreeView.Nodes))
- {
- this.lbDataStatisticsQueryInfo.Text = "统计时间和门店已改变,需要重新进行“数据统计查询”才能准确计算业绩和提成";
- }
- else
- {
- this.lbDataStatisticsQueryInfo.Text = "统计时间已改变,需要重新进行“数据统计查询”才能准确计算业绩和提成";
- }
- }
- }
- else {
- this.lbDataStatisticsQueryInfo.Text = WageStatisticsInfo;
- }
- }
- /// <summary>
- /// 统计查询工资基出数据
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnDataStatisticsQuery_Click(object sender, EventArgs e)
- {
- GetEmployeeBasicQueryUserList();
- GetCurrentQueryStoreList();
- GetTimePeriod();
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate (object obj, BackgroundWorker backgroundWorker)
- {
- try
- {
- backgroundWorker.ReportProgress(0, "正获取项目类别...");
- frmEditStatisticsProgram.LoadAllSystemCategory();
- backgroundWorker.ReportProgress(0, "正获取基本工资...");
- LoadWagesSetDataTable();
- backgroundWorker.ReportProgress(0, "正获取奖罚金额...");
- LoadRewardPunishment(StartDateTime, EndDateTime);
- LoadBasisWageStatisticsDataTable(backgroundWorker);
- if (WSO_WageStatisticsOrderInfo != null)
- {
- WSO_WageStatisticsOrderInfo = null;
- }
- if (WSO_WageStatisticsCurrentOrderInfo != null)
- {
- WSO_WageStatisticsCurrentOrderInfo = null;
- }
- backgroundWorker.ReportProgress(0, "正在统计订单...");
- WSO_WageStatisticsOrderInfo = new WageStatisticsOrderInfo(WSP_WageStatisticsProcess.RelatedOrderCount);//统计相关总订单数信息
- WSO_WageStatisticsCurrentOrderInfo = new WageStatisticsOrderInfo(WSP_WageStatisticsProcess.CurrentRelatedOrderCount);//统计相关总订单数信息
- DataStatisticsQueryTimestamp = GetDataStatisticsQueryTimestamp();
- }
- catch(Exception ex) {
- MessageBoxCustom.Show(ex.Message);
- }
- });
- WageStatisticsInfo = WSO_WageStatisticsOrderInfo.ToString() + "\r\n" + WSO_WageStatisticsCurrentOrderInfo.ToString("在统计时间内的订单数");
- RefreshDataStatisticsQuery();
-
- }
- void dgvStatisticsList_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
- {
- if (e.RowIndex >= 0 && e.ColumnIndex == 2)
- {
- if (this.dgvStatisticsList.Rows[e.RowIndex].Tag != null)
- {
- frmWageQueryConfig frmWQC = new frmWageQueryConfig();
- frmWQC.CurrentUser_EmployeeID = this.dgvStatisticsList.Rows[e.RowIndex].Tag.ToString();
- frmWQC.ShowDialog();
- }
- }
- }
- void btnProgramSetting_Click(object sender, EventArgs e)
- {
- frmWageQueryConfig frmWQC = new frmWageQueryConfig();
- frmWQC.ShowDialog();
- }
- #region 窗体首次加载和显示事件
- void frmWageStatisticsQuery_Load(object sender, EventArgs e)
- {
- this.dgvStatisticsList.Columns[0].Visible = LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition;
- HideORShowStoresList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
- }
- void frmWageStatisticsQuery_Shown(object sender, EventArgs e)
- {
- // 部门人员绑定
- LYFZ.Software.MainBusiness.DoorCityProcess.PublicCodeClasses.BindComboBoxTreeView_DepartmentAndEmployee(this.cmbEmployeeName, IsFirstNodeNull: true, IsFirstNodeName: "全部", IsShowResign: false, IsShowAdmin: true, tb_User: LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable);
- // 查看
- this.cmbEmployeeName.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.ViewAll);
- this.cmbEmployeeName.TagFindText(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.LoginUserModel.User_EmployeeID);
- this.btnExport.Enabled=LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.DataExport);
- this.btnProgramSetting.Enabled = LYFZ.BLL.BLL_ErpUser.GetRights(LYFZ.BLL.BLL_ErpUser.CurrentUserRights.StatisticalInquiryAllWagesCompetence, CustomAttributes.OperatingAuthority.WageProgramSetting);
- //绑定门店
- BindStoreList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.IsGroupEdition);
- BindTimePeriod();
- GetEmployeeBasicQueryUserList();
- GetCurrentQueryStoreList();
- GetTimePeriod();
- BindWageStatisticsQuery(true);
- }
- static DataTable _WagesSetDataTable = null;
- /// <summary>
- /// 员工基本工资集合
- /// </summary>
- public static DataTable WagesSetDataTable
- {
- get {
- if (_WagesSetDataTable == null)
- {
- LoadWagesSetDataTable();
- }
- return frmWageStatisticsQuery._WagesSetDataTable; }
- }
- public static LYFZ.BLL.BLL_ErpWagesSet wagesSetBll = new BLL_ErpWagesSet();
- /// <summary>
- /// 加载员工基本工资集合
- /// </summary>
- public static void LoadWagesSetDataTable()
- {
-
- if (_WagesSetDataTable != null)
- {
- _WagesSetDataTable.Rows.Clear();
- _WagesSetDataTable.Dispose();
- _WagesSetDataTable = null;
- }
- _WagesSetDataTable = wagesSetBll.GetAllList().Tables[0];
- }
- /// <summary>
- /// 获取指定用户的基本工资
- /// </summary>
- /// <param name="uid"></param>
- /// <returns></returns>
- public static decimal GetBasicWage(string uid)
- {
- foreach (DataRow row in WagesSetDataTable.Rows)
- {
- if (row["Ws_StaffCode"].ToString().Trim().ToLower() == uid.ToLower().Trim() && row["Ws_BasicWage"]!=null)
- {
- return Convert.ToDecimal(row["Ws_BasicWage"]);
- }
- }
- return 0;
- }
- /// <summary>
- /// 获取指定用户的工资统计方案列表
- /// </summary>
- /// <param name="uid"></param>
- /// <returns></returns>
- public static string GetCommissionScheme(string uid)
- {
- try
- {
- foreach (DataRow row in WagesSetDataTable.Rows)
- {
- if (row["Ws_StaffCode"].ToString().Trim().ToLower() == uid.ToLower().Trim())
- {
- return row["Ws_EarlyCommissionScheme"].ToString();
- }
- }
- }
- catch {
-
- }
- return "";
- }
- //创建一个委托,是为访问DataGridVie控件服务的。
- // public delegate void UpdateControl();
- /// <summary>
- /// 用户工资计算结果集合
- /// </summary>
- List<UserWageStatisticsPerformanceCommission> UserWageStatisticsPerformanceCommissionList = new List<UserWageStatisticsPerformanceCommission>();
- /// <summary>
- /// 绑定工资查询结果
- /// </summary>
- void BindWageStatisticsQuery(bool isLoadData)
- {
- if (CurrentQueryUserList == null)
- {
- MessageBoxCustom.Show("请选择员工");
- return;
- }
- // LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable;
- if (isLoadData)
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- backgroundWorker.ReportProgress(0, "正在初始化查询,请稍等...");
- frmEditStatisticsProgram.LoadAllSystemCategory();
- LoadWagesSetDataTable();
- if (frmWageQueryConfig.WQCTable.Rows.Count <= 0)
- {
- MessageBoxCustom.Show("系统检查到你还没有设置任何工资统计方案,建义您先设置后再查询工资。");
- }
- });
- }
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- backgroundWorker.ReportProgress(0, "正在查询数据,请稍等...");
- LoadRewardPunishment(StartDateTime, EndDateTime);
- });
- this.dgvStatisticsList.Rows.Clear();
- this.UserWageStatisticsPerformanceCommissionList.Clear();
- #region 计算统计工资,业绩提成
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- backgroundWorker.ReportProgress(0, "正在计算工资,请稍等...");
- try
- {
- WageStatisticsProcess.LoadCommissionPercentageSetInfo();
- }
- catch (Exception ex){
- MessageBoxCustom.Show("业绩划分提成比例设置不正确,请重新设置后重试。\r\n"+ex.Message);
- return;
- }
- try
- {
- foreach (DataRow row in LYFZ.DAL.DAL_ErpUser.SimpleUserDataTable.Rows)
- {
- string User_EmployeeID = row["User_EmployeeID"].ToString();
- if (CurrentQueryUserList.CheckRange(row["User_DividedShop"].ToString(), row["User_Department"].ToString(), User_EmployeeID) && row["User_Status"].ToString() != "离职")
- {
- UserWageStatisticsPerformanceCommission uwspc = new UserWageStatisticsPerformanceCommission();
- uwspc.User_DividedShop = row["User_DividedShop"].ToString();
- uwspc.User_DividedShopName = GetStoreSPIDToSPName(uwspc.User_DividedShop);
- uwspc.User_Department = Convert.ToInt32(row["User_Department"].ToString());
- uwspc.Dt_Name = row["Dt_Name"].ToString();
- uwspc.User_EmployeeID = User_EmployeeID;
- uwspc.User_Name = row["User_Name"].ToString();
- backgroundWorker.ReportProgress(0, "计算[" + uwspc.User_Name.Trim() + "]的业绩请稍等...");
- string[] CommissionSchemeList = GetCommissionScheme(User_EmployeeID).Split(',');
- for (int i = 0; i < CommissionSchemeList.Length; i++)
- {
- if (!string.IsNullOrEmpty(CommissionSchemeList[i]))
- {
- LYFZ.Model.Model_WageQueryConfig wqcModel = frmWageQueryConfig.FindWageQueryConfig(CommissionSchemeList[i]);
- if (wqcModel != null)
- {
- PerformanceCommissionInfo pcInfo = WSP_WageStatisticsProcess.GetPerformanceCommissionInfo(wqcModel, User_EmployeeID);
- uwspc.PerformanceCommissionList.Add(pcInfo);
- }
- }
- }
- UserWageStatisticsPerformanceCommissionList.Add(uwspc);
- }
- }
- }
- catch (Exception ex){
- MessageBoxCustom.Show("计算统计工资时出错:"+ex.Message);
- }
- });
- #endregion
-
- DataGridViewRow dgRow = null;
- foreach (UserWageStatisticsPerformanceCommission userWSPC in UserWageStatisticsPerformanceCommissionList)
- {
- dgRow = new DataGridViewRow();
- dgRow.CreateCells(this.dgvStatisticsList);
-
- dgRow.Cells[0].Style = GetDataGridViewCellStyle(System.Drawing.Color.LightCyan, DataGridViewContentAlignment.MiddleLeft);
- dgRow.Cells[1].Style = dgRow.Cells[0].Style;
- dgRow.Cells[1].Style = dgRow.Cells[0].Style;
- dgRow.Cells[2].Style = dgRow.Cells[0].Style;
- dgRow.Cells[3].Style = dgRow.Cells[0].Style;
- dgRow.Cells[4].Style = dgRow.Cells[0].Style;
- dgRow.Cells[5].Style = dgRow.Cells[0].Style;
- dgRow.Cells[6].Style = dgRow.Cells[0].Style;
- dgRow.Cells[7].Style = dgRow.Cells[0].Style;
- dgRow.Cells[8].Style = dgRow.Cells[0].Style;
- dgRow.Cells[9].Style = dgRow.Cells[0].Style;
- dgRow.Cells[10].Style = dgRow.Cells[0].Style;
- dgRow.Cells[11].Style = dgRow.Cells[0].Style;
- dgRow.Cells[0].Value = userWSPC.User_DividedShopName;
- dgRow.Cells[1].Value = userWSPC.Dt_Name;
- dgRow.Cells[2].Value = userWSPC.User_Name;
- userWSPC.BasicWage = GetBasicWage(userWSPC.User_EmployeeID);//基本工资
- dgRow.Cells[3].Value = userWSPC.BasicWage;
- dgRow.Tag = userWSPC.User_EmployeeID;
- userWSPC.Bonus = GetRewardPunish(userWSPC.User_EmployeeID, true);//奖金
- dgRow.Cells[4].Value = userWSPC.Bonus;
- userWSPC.FineMoney = -GetRewardPunish(userWSPC.User_EmployeeID, false);//罚金
- dgRow.Cells[5].Value = userWSPC.FineMoney;//罚金
- dgRow.Cells[7].Value = "合计";
- dgRow.Cells[8].Value = "";
- userWSPC.SumComputePerformanceCommission();
- dgRow.Cells[9].Value = userWSPC.SumPerformance;//总业绩
- dgRow.Cells[10].Value = userWSPC.SumCommission;//总提成金额
- dgRow.Cells[11].Value = "";
- //总工资=基本工资+奖金+(-罚金)+总提成金额
- dgRow.Cells[6].Value = Convert.ToDecimal(dgRow.Cells[3].Value) + Convert.ToDecimal(dgRow.Cells[4].Value) + Convert.ToDecimal(dgRow.Cells[5].Value) + Convert.ToDecimal(dgRow.Cells[10].Value);
- this.dgvStatisticsList.Rows.Add(dgRow);
- for (int i = 0; i < userWSPC.PerformanceCommissionList.Count; i++)
- {
- if (i == userWSPC.PerformanceCommissionList.Count - 1)
- {
- this.dgvStatisticsList.Rows.Add(GetSubDataGridViewRow(userWSPC.PerformanceCommissionList[i], true));
- }
- else
- {
- this.dgvStatisticsList.Rows.Add(GetSubDataGridViewRow(userWSPC.PerformanceCommissionList[i]));
- }
- }
- }
- this.dgvStatisticsList.ClearSelection();
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="wqcRow">统计查询方案</param>
- /// <param name="uEmployeeID"></param>
- /// <param name="isEndRow"></param>
- /// <returns></returns>
- DataGridViewRow GetSubDataGridViewRow(PerformanceCommissionInfo pcInfo, bool isEndRow = false)
- {
- LYFZ.Model.WageStatisticsQueryItem wItem = (LYFZ.Model.WageStatisticsQueryItem)Convert.ToInt32(pcInfo.WageQueryProgram.WQC_StatisticalItems);
- DataGridViewRow dgRow = new DataGridViewRow();
- dgRow.CreateCells(this.dgvStatisticsList);
- dgRow.Cells[0].Style = GetDataGridViewCellStyle(System.Drawing.Color.White, DataGridViewContentAlignment.MiddleLeft);
- dgRow.Cells[1].Style = dgRow.Cells[0].Style;
- dgRow.Cells[1].Style = dgRow.Cells[0].Style;
- dgRow.Cells[2].Style = dgRow.Cells[0].Style;
- dgRow.Cells[3].Style = dgRow.Cells[0].Style;
- dgRow.Cells[4].Style = dgRow.Cells[0].Style;
- dgRow.Cells[5].Style = dgRow.Cells[0].Style;
- dgRow.Cells[6].Style = dgRow.Cells[0].Style;
- dgRow.Cells[7].Style = dgRow.Cells[0].Style;
- dgRow.Cells[8].Style = dgRow.Cells[0].Style;
- dgRow.Cells[9].Style = dgRow.Cells[0].Style;
- dgRow.Cells[10].Style = dgRow.Cells[0].Style;
- dgRow.Cells[11].Style = dgRow.Cells[0].Style;
- dgRow.Tag = pcInfo;
- dgRow.Cells[7].Value = wItem.ToString();
- 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;
- }
- dgRow.Cells[8].Value = pcInfo.WageQueryProgram.WQC_QueryName;
- dgRow.Cells[9].Value = pcInfo.Performance;
- dgRow.Cells[10].Value = pcInfo.Commission;
- dgRow.Cells[11].Value = pcInfo.CommissionMsg;
- return dgRow;
- }
- string GetStoreSPIDToSPName(string sid)
- {
- foreach (ItemValue item in this.cbxStoreList.Items)
- {
- if (item.Value.ToString().ToLower() == sid.ToLower())
- {
- return item.Text.Trim();
- }
- }
- return "未知";
- }
- System.Windows.Forms.DataGridViewCellStyle GetDataGridViewCellStyle(System.Drawing.Color bgcolor, 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("微软雅黑", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Black;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- return dataGridViewCellStyle2;
- }
- #endregion
- /// <summary>
- /// 开始时间
- /// </summary>
- DateTime StartDateTime;
- /// <summary>
- /// 结束时间
- /// </summary>
- DateTime EndDateTime;
- /// <summary>
- /// 当前要查询的门店信息集合
- /// </summary>
- QueryStoreList CurrentQueryStoreList=null;
- /// <summary>
- /// 当前查询用户集合
- /// </summary>
- BasicQueryUserList CurrentQueryUserList = null;
- void btnQuery_Click(object sender, EventArgs e)
- {
- GetEmployeeBasicQueryUserList();
- GetCurrentQueryStoreList();
- GetTimePeriod();
- #if !DEBUG
- if (!isDataStatisticsQuery)
- {
- MessageBoxCustom.Show("检查到您还没有进行“数据统计查询”,将只能统计到基本工资奖罚金额。");
- }
- #endif
- BindWageStatisticsQuery(false);
- }
- void btntest_Click(object sender, EventArgs e)
- {
- if (MessageBoxCustom.Show("旧版工资管理已过时,将不在升级和维护。\r\n您确定要续续打开吗?", msgBoxButton: MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK)
- {
- FrmPayroll fpll = new FrmPayroll();
- fpll.Show();
- }
- }
- #region 开始统计工资
- #region 奖罚记录表
- /// <summary>
- /// 员工奖罚
- /// </summary>
- DataTable _RewardPunishment = null;
- LYFZ.BLL.BLL_ErpRewardPunishment rphBll = new BLL_ErpRewardPunishment();
- string tempQueryTimestamp = "";
- /// <summary>
- /// 奖
- /// </summary>
- Hashtable SumRewardTable = new Hashtable();
- /// <summary>
- /// 罚
- /// </summary>
- Hashtable SumPunishTable = new Hashtable();
- /// <summary>
- /// 加载员工奖罚
- /// </summary>
- /// <param name="starDate"></param>
- /// <param name="endDate"></param>
- void LoadRewardPunishment(DateTime starDate, DateTime endDate)
- {
- string newTempQueryTimestamp = starDate.ToString("yyyy-MM-dd") + starDate.AddDays(1).ToString("yyyy-MM-dd");
- if (_RewardPunishment != null)
- {
- if (!string.IsNullOrEmpty(tempQueryTimestamp) && newTempQueryTimestamp == tempQueryTimestamp)
- {
- return;
- }
- _RewardPunishment.Rows.Clear();
- _RewardPunishment.Dispose();
- _RewardPunishment = null;
- }
- _RewardPunishment = rphBll.GetList(" Rp_Status='薪资执行' and (Rp_RPDatetime>='" + starDate.ToString("yyyy-MM-dd") + "' and Rp_RPDatetime<'" + endDate.AddDays(1).ToString("yyyy-MM-dd") + "')", " Rp_Type,rp_money desc").Tables[0];
- SumRewardPunish();
- tempQueryTimestamp = newTempQueryTimestamp;
- }
- /// <summary>
- /// 计算奖罚
- /// </summary>
- void SumRewardPunish()
- {
- SumRewardTable.Clear();
- SumPunishTable.Clear();
- foreach (DataRow row in _RewardPunishment.Rows)
- {
- string Rp_RelevantPeople = row["Rp_RelevantPeople"].ToString();
- decimal Rp_Money = Convert.ToDecimal(row["Rp_Money"].ToString());
- switch (row["Rp_Type"].ToString())
- {
- case "奖励":
- if (SumRewardTable.ContainsKey(Rp_RelevantPeople))
- {
- SumRewardTable[Rp_RelevantPeople] = Convert.ToDecimal(SumRewardTable[Rp_RelevantPeople]) + Rp_Money;
- }
- else {
- SumRewardTable.Add(Rp_RelevantPeople, Rp_Money);
- }
- break;
- case "惩罚":
- if (SumPunishTable.ContainsKey(Rp_RelevantPeople))
- {
- SumPunishTable[Rp_RelevantPeople] = Convert.ToDecimal(SumPunishTable[Rp_RelevantPeople]) + Rp_Money;
- }
- else
- {
- SumPunishTable.Add(Rp_RelevantPeople, Rp_Money);
- }
- break;
- }
- }
- }
- /// <summary>
- /// 获取指定人员的奖罚金额
- /// </summary>
- /// <param name="uid">指定人员的ID</param>
- /// <param name="isRewardPunish">true 为奖 false 罚</param>
- /// <returns></returns>
- decimal GetRewardPunish(string uid, bool isRewardPunish)
- {
- if (isRewardPunish)
- {
- if (SumRewardTable.ContainsKey(uid))
- {
- return Convert.ToDecimal(SumRewardTable[uid]);
- }
- }
- else {
- if (SumPunishTable.ContainsKey(uid))
- {
- return Convert.ToDecimal(SumPunishTable[uid]);
- }
- }
- return 0;
- }
- #endregion
- #region 订单前期 统计门市前期业绩
-
- #endregion
- #endregion
- #region 初始查询条件绑定
- /// <summary>
- /// 获取时间段
- /// </summary>
- void GetTimePeriod()
- {
- this.StartDateTime = this.txtTimeStart.Value;
- this.EndDateTime = this.txtTimeEnd.Value;
- WSP_WageStatisticsProcess.StartDateTime = this.StartDateTime;
- WSP_WageStatisticsProcess.EndDateTime = this.EndDateTime;
- }
-
- void txtTimeStart_ValueChanged(object sender, EventArgs e)
- {
- this.txtTimeEnd.Value = this.txtTimeStart.Value.AddMonths(1).AddDays(-1);
- RefreshDataStatisticsQuery();
- }
- void txtTimeEnd_ValueChanged(object sender, EventArgs e)
- {
- RefreshDataStatisticsQuery();
- }
- /// <summary>
- /// 获取当前要查询的门店信息集合
- /// </summary>
- void GetCurrentQueryStoreList()
- {
- if (CurrentQueryStoreList == null)
- {
- CurrentQueryStoreList = new QueryStoreList();
- }
- else
- {
- CurrentQueryStoreList.QueryStoreInfoList.Clear();
- }
- ItemValue cItem = (ItemValue)this.cbxStoreList.SelectedItem;
- if (cItem.Value.ToString() == "0")
- {
- CurrentQueryStoreList.QueryType = 0;
- }
- else if (cItem.Value.ToString() == "1")
- {
- CurrentQueryStoreList.QueryType = 1;
- foreach (ItemValue item in this.cbxStoreList.Items)
- {
- if (item.Tag != null)
- {
- QueryStoreInfo qStoreInfo = GetQueryStoreInfo(item);
- if (qStoreInfo != null)
- {
- CurrentQueryStoreList.QueryStoreInfoList.Add(qStoreInfo);
- }
- }
- }
- }
- else
- {
- CurrentQueryStoreList.QueryType = 1;
- QueryStoreInfo qStoreInfo = GetQueryStoreInfo(cItem);
- if (qStoreInfo != null)
- {
- CurrentQueryStoreList.QueryStoreInfoList.Add(qStoreInfo);
- }
- }
- }
- QueryStoreInfo GetQueryStoreInfo(ItemValue item)
- {
- if (item.Tag != null)
- {
- QueryStoreInfo qStoreInfo = new QueryStoreInfo();
- qStoreInfo.DividedShop = item.Value.ToString();
- qStoreInfo.DividedShop_Name = item.Text.Trim();
- qStoreInfo.JMGDomain = ((DataRow)item.Tag)["Company_JMGDomain"].ToString();
- return qStoreInfo;
- }
- return null;
- }
- /// <summary>
- /// 获取当前选择的用户集合
- /// </summary>
- /// <returns></returns>
- void GetEmployeeBasicQueryUserList()
- {
- if (CurrentQueryUserList == null)
- {
- CurrentQueryUserList = new BasicQueryUserList();
- }
- else {
- CurrentQueryUserList.BasicUsers.Clear();
- }
- if (this.cmbEmployeeName.Tag != null&& this.cmbEmployeeName.TreeView.SelectedNode!=null)
- {
- string dataValue = this.cmbEmployeeName.Tag.ToString();
- string dataType = this.cmbEmployeeName.StrGetName.Trim();
- if (dataType.Length > 0)
- {
- switch (dataType.ToLower())
- {
- case "storename":
- CurrentQueryUserList.SelectTypeValue = dataValue;
- CurrentQueryUserList.SelectUserType = 1;
- break;
- case "department":
- if (IsStoreNode(this.cmbEmployeeName.TreeView.Nodes))
- {
- CurrentQueryUserList.SelectTypeValue = this.cmbEmployeeName.TreeView.SelectedNode.Parent.Tag.ToString() + "," + dataValue;
- }
- else {
- CurrentQueryUserList.SelectTypeValue = dataValue;
- }
- CurrentQueryUserList.SelectUserType = 2;
- break;
- case "user":
- CurrentQueryUserList.SelectTypeValue = dataValue;
- CurrentQueryUserList.SelectUserType = 3;
- break;
- default:
- CurrentQueryUserList.SelectTypeValue = "";
- CurrentQueryUserList.SelectUserType = 0;
- break;
- }
- }
- else {
- CurrentQueryUserList.SelectUserType = 0;
- }
- switch (CurrentQueryUserList.SelectUserType)
- {
- /* case 0:
- CurrentQueryUserList.BasicUsers = GetBasicQueryUserList(this.cmbEmployeeName.TreeView.Nodes, IsStoreNode(this.cmbEmployeeName.TreeView.Nodes));
- break;*/
- case 1:
- case 2:
- CurrentQueryUserList.BasicUsers = GetBasicQueryUserList(this.cmbEmployeeName.TreeView.SelectedNode.Nodes, IsStoreNode(this.cmbEmployeeName.TreeView.Nodes));
- break;
- case 3:
- CurrentQueryUserList.BasicUsers = GetBasicQueryUserList(this.cmbEmployeeName.TreeView.SelectedNode, IsStoreNode(this.cmbEmployeeName.TreeView.Nodes));
- break;
- }
-
- }
- else {
- MessageBoxCustom.Show("请选择要查询的员工!");
- }
- }
- /// <summary>
- /// 判断是否存在门店节点
- /// </summary>
- /// <param name="nodes"></param>
- /// <returns></returns>
- bool IsStoreNode(TreeNodeCollection nodes)
- {
- bool ret = false;
- foreach (TreeNode node in nodes)
- {
- string dataType = node.Name.Trim().ToLower();
- if (dataType == "storename")
- {
- ret = true;
- break;
- }
- }
- return ret;
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="nodes"></param>
- /// <param name="isStore">是否有门店节点</param>
- /// <returns></returns>
- List<BasicQueryUser> GetBasicQueryUserList(object nodes, bool isStore = false)
- {
- List<BasicQueryUser> retList = new List<BasicQueryUser>();
- string DividedShop = "";
- string DividedShopName = "";
- int DepartmentID = 0;
- string DepartmentName = "";
- TreeNodeCollection tNodes = null;
- if (nodes.GetType() == typeof(TreeNode))
- {
- TreeNode userNode = (TreeNode)nodes;
- if (userNode.Parent != null)
- {
- if (isStore)
- {
- DividedShop = userNode.Parent.Parent.Tag.ToString();
- DividedShopName = userNode.Parent.Parent.Text.Trim();
- }
- if (userNode.Parent.Tag != null)
- {
- DepartmentID = Convert.ToInt32(userNode.Parent.Tag.ToString());
- DepartmentName = userNode.Parent.Text.Trim();
- BasicQueryUser cuser = new BasicQueryUser();
- cuser.DividedShop = DividedShop;
- cuser.DividedShopName = DividedShopName;
- cuser.DepartmentID = DepartmentID;
- cuser.DepartmentName = DepartmentName;
- cuser.UserID = userNode.Tag.ToString().Trim();
- cuser.UserName = userNode.Text.Trim();
- retList.Add(cuser);
- }
- }
-
- }
- else
- {
- tNodes = (TreeNodeCollection)nodes;
- }
- if (tNodes != null)
- {
- foreach (TreeNode node in tNodes)
- {
- if (node.Tag != null && node.Tag.ToString().Length > 0)
- {
- string dataType = node.Name.Trim().ToLower();
- switch (dataType.ToLower())
- {
-
- case "department":
- if (isStore)
- {
- DividedShop = node.Parent.Tag.ToString();
- DividedShopName = node.Parent.Text.Trim();
- }
- DepartmentID = Convert.ToInt32(node.Tag.ToString());
- DepartmentName = node.Text.Trim();
- foreach (TreeNode cnode in node.Nodes)
- {
- if (cnode.Tag != null && cnode.Tag.ToString().Trim().Length > 0)
- {
- BasicQueryUser user = new BasicQueryUser();
- user.DividedShop = DividedShop;
- user.DividedShopName = DividedShopName;
- user.DepartmentID = DepartmentID;
- user.DepartmentName = DepartmentName;
- user.UserID = cnode.Tag.ToString().Trim();
- user.UserName = cnode.Text.Trim();
- retList.Add(user);
- }
- }
- break;
- case "user":
- if (isStore)
- {
- DividedShop = node.Parent.Parent.Tag.ToString();
- DividedShopName = node.Parent.Parent.Text.Trim();
- }
- DepartmentID = Convert.ToInt32(node.Parent.Tag.ToString());
- DepartmentName = node.Parent.Text.Trim();
- BasicQueryUser cuser = new BasicQueryUser();
- cuser.DividedShop = DividedShop;
- cuser.DividedShopName = DividedShopName;
- cuser.DepartmentID = DepartmentID;
- cuser.DepartmentName = DepartmentName;
- cuser.UserID = node.Tag.ToString().Trim();
- cuser.UserName = node.Text.Trim();
- retList.Add(cuser);
- break;
- }
- }
- }
- }
- return retList;
- }
- void bntClosed_Click(object sender, EventArgs e)
- {
- this.Close();
- }
-
- /// <summary>
- /// 根是是否集团版显示隐藏门店列表
- /// </summary>
- /// <param name="isGroupEdition"></param>
- void HideORShowStoresList(bool isGroupEdition)
- {
- if (isGroupEdition)
- {
- this.cbxStoreList.Show();
- this.labelEx3.Show();
-
- }
- else {
- this.cbxStoreList.Hide();
- this.labelEx3.Hide();
- }
- }
- /// <summary>
- /// 绑定时间段
- /// </summary>
- void BindTimePeriod()
- {
- this.txtTimeStart.Value = new DateTime(SDateTime.Now.Year, SDateTime.Now.Month, 1);
- this.txtTimeEnd.Value = this.txtTimeStart.Value.AddMonths(1).AddDays(-1);
- }
- /// <summary>
- /// 邦定门店
- /// </summary>
- void BindStoreList(bool isGroupEdition)
- {
- DataRowCollection rows = null;
- int allValue = 0;
- int allStoreCount = 1;
- if (isGroupEdition)
- {
- LYFZ.ComponentLibrary.FrmLoadHandling.LoadDoWorkMethod(delegate(object obj, BackgroundWorker backgroundWorker)
- {
- rows = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoList(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim());
- allStoreCount = LYFZ.DAL.DAL_ErpCompanyInfo.GetCompanyBasicInfoListCount();
- });
- if (rows == null)
- {
- MessageBoxCustom.Show("获取门店信息失败!");
- return;
- }
- else
- {
- if (allStoreCount > 1 && allStoreCount == rows.Count)
- {
- allValue = 0;
- }
- else
- {
- allValue = 1;
- }
- if (rows.Count > 1)
- {
- ItemValue itemAll = new ItemValue(allValue, "全部");
- this.cbxStoreList.Items.Add(itemAll);
- this.cbxStoreList.SelectedIndex = 0;
- }
- //是否找到当前店
- bool isCurrentStore = false;
- foreach (DataRow row in rows)
- {
- ItemValue itemStore = new ItemValue(row["Company_DividedShop"].ToString(), row["Company_Name"].ToString());
- itemStore.Tag = row;
- this.cbxStoreList.Items.Add(itemStore);
- if (row["Company_JMGDomain"].ToString().Trim().ToLower() == LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.SoftwareInfo.SDomainName.Trim().ToLower())
- {
- isCurrentStore = true;
- if (allValue == 1)
- {
- this.cbxStoreList.SelectedItem = itemStore;
- }
- }
- }
- if (!isCurrentStore)
- {
- MessageBoxCustom.Show("没有找到当前门店信息");
- this.cbxStoreList.Items.Clear();
- return;
- }
- }
- }
- else {
- ItemValue itemAll = new ItemValue(allValue, "全部");
- this.cbxStoreList.Items.Add(itemAll);
- this.cbxStoreList.SelectedIndex = 0;
- }
-
-
-
-
- }
- #endregion
- }
-
- }
|