1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404 |
- using LYFZ.ComponentLibrary;
- 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;
- namespace LYFZ.Software.MainBusiness.StatisticalInquiry
- {
- public partial class FrmStatisticalInquiryPayroll : LYFZ.Software.UI.StatisticalInquiry.FrmStatisticalInquiryPayroll
- {
- public FrmStatisticalInquiryPayroll()
- {
- }
- public string User_EmployeeID = "";
- public string TimeStart = "";
- public string TimeEnd = "";
- decimal Piece = 0; //计件提成
- #region 加载
- protected override void FrmStatisticalInquiryPayroll_Shown(object sender, EventArgs e)
- {
- WaitForm wf = new WaitForm();
- wf.ShowForm(this);
- try
- {
- #region 部门人员绑定
- LYFZ.BLL.BLL_ErpDepartment BLLerpdepartment = new BLL.BLL_ErpDepartment();
- DataTable tbl = BLLerpdepartment.GetAllList().Tables[0];
- if (tbl.Rows.Count > 0)
- {
- TreeNode root = null;
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- root = new TreeNode(tbl.Rows[i]["Dt_Name"].ToString());
- this.CreateTreeViewDepartmentUser(root.Nodes, tbl.Rows[i]["ID"].ToString());
- this.txtTsorder_OpenSingle.TreeView.Nodes.Add(root);
- }
- }
- #endregion
- if (!string.IsNullOrEmpty(User_EmployeeID))
- {
- dgv1.Rows.Clear();
- dgv2.Rows.Clear();
- dgv3.Rows.Clear();
- dgv4.Rows.Clear();
- txtWs_BasicWage.Text = "";
- txtEarlyResults.Text = "";
- txtTwoPinsResults.Text = "";
- txtPieceCommission.Text = "";
- txtTotalWages.Text = "";
- txtTsorder_OpenSingle.TagFindText("");
- txtTsorder_OpenSingle.TagFindText(User_EmployeeID);
- txtTimeStart.Text = TimeStart;
- txtTimeEnd.Text = TimeEnd;
- LYFZ.BLL.BLL_ErpWagesSet wagesBll = new BLL.BLL_ErpWagesSet();
- #region 获取人员基本信息
- DataTable wagesdt = wagesBll.GetList("Ws_StaffCode='" + txtTsorder_OpenSingle.Tag.ToString() + "'").Tables[0];
- if (wagesdt.Rows.Count > 0)
- {
- txtWs_Remark.Text = wagesdt.Rows[0]["Ws_Remark"].ToString();
- txtWs_BasicWage.Text = wagesdt.Rows[0]["Ws_BasicWage"].ToString();
- }
- else
- {
- txtWs_Remark.Text = "";
- txtWs_BasicWage.Text = "0.00";
- }
- #endregion
- #region 获取列表
- //订单,二销提成数据源绑定
- BindSalarylist(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- //摄影与助理数据源绑定
- PhotographyBind();
- //修片与精修与设计
- BindPhoto();
- //计件提成
- BindPiece(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- #endregion
- #region 获取工资
- GetWages(txtTsorder_OpenSingle.Tag.ToString());
- #endregion
- #region 自动统计
- BindAutomaticStatistics(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- #endregion
- }
- else
- {
- txtTimeStart.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().AddDays(1 - LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().Day)).ToString("yyyy-MM-dd");
- txtTimeEnd.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime()).AddDays(1 - LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().Day).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd");
- }
- wf.CloseForm();
- wf = null;
- return;
- }
- catch
- {
- wf.CloseForm();
- wf = null;
-
- }
- }
- #endregion
- #region 选择人员事件
- protected override void txtTsorder_OpenSingle_ComboBoxTreeViewEx_TextChanged(object sender, EventArgs e)
- {
- WaitForm wf = new WaitForm();
- wf.ShowForm(this);
- try
- {
- dgv1.Rows.Clear();
- dgv2.Rows.Clear();
- dgv3.Rows.Clear();
- dgv4.Rows.Clear();
- txtWs_BasicWage.Text = "";
- txtEarlyResults.Text = "";
- txtTwoPinsResults.Text = "";
- txtPieceCommission.Text = "";
- txtTotalWages.Text = "";
- if (string.IsNullOrEmpty(txtTimeStart.Text) || string.IsNullOrEmpty(txtTimeEnd.Text))
- {
- MessageBoxCustom.Show("请输入时间!");
- return;
- }
- txtTsorder_OpenSingle.TextFindTag(txtTsorder_OpenSingle.Text.ToString());
- LYFZ.BLL.BLL_ErpWagesSet wagesBll = new BLL.BLL_ErpWagesSet();
- #region 获取人员基本信息
- DataTable wagesdt = wagesBll.GetList("Ws_StaffCode='" + txtTsorder_OpenSingle.Tag.ToString() + "'").Tables[0];
- if (wagesdt.Rows.Count > 0)
- {
- txtWs_Remark.Text = wagesdt.Rows[0]["Ws_Remark"].ToString();
- txtWs_BasicWage.Text = wagesdt.Rows[0]["Ws_BasicWage"].ToString();
- }
- else
- {
- txtWs_Remark.Text = "";
- txtWs_BasicWage.Text = "0.00";
- }
- #endregion
- #region 获取列表
- //订单,二销提成数据源绑定
- BindSalarylist(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- //摄影与助理数据源绑定
- PhotographyBind();
- //修片与精修与设计
- BindPhoto();
- //计件提成
- BindPiece(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- #endregion
- #region 获取工资
- GetWages(txtTsorder_OpenSingle.Tag.ToString());
- #endregion
- #region 自动统计
- BindAutomaticStatistics(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- #endregion
- wf.CloseForm();
- wf = null;
- }
- catch
- {
- wf.CloseForm();
- wf = null;
- }
- }
- #region 订单,二销提成数据源绑定
- /// <summary>
- /// 订单,二销提成数据源绑定
- /// </summary>
- /// <param name="Tsorder_OpenSingle"></param>
- /// <param name="TimeStart"></param>
- /// <param name="TimeEnd"></param>
- public void BindSalarylist(string Tsorder_OpenSingle, string TimeStart, string TimeEnd)
- {
- try
- {
- LYFZ.BLL.BLL_ErpSystemConfigure SystemConfigureBll = new BLL.BLL_ErpSystemConfigure(); ;
- LYFZ.BLL.BLL_ErpWagesSet WagesSetBll = new BLL.BLL_ErpWagesSet();
- LYFZ.BLL.BLL_ErpOrdersPhotography OrdersPhotographyBll = new BLL.BLL_ErpOrdersPhotography();
- DataTable dt = new DataTable();
- StringBuilder sql = new StringBuilder();
- #region 查询人员是否有订单收款记录(前期,二销,其它消费)
- // or Ordpg_PhotographerId like '%" + Tsorder_OpenSingle + "%' or Ordpg_PhotographyAssistantId like '%" + Tsorder_OpenSingle + "%' or Ordpg_MakeupArtistId like '%" + Tsorder_OpenSingle + "%' or Ordpg_MakeupAssistantId like '%" + Tsorder_OpenSingle + "%' or Ordpg_BootDivisionId like '%" + Tsorder_OpenSingle + "%'
- sql.Append(" and (Pay_OpenSingle like '%" + Tsorder_OpenSingle + "%')");
- sql.Append(" and (Pay_CreateDatetime>='" + TimeStart + "' and Pay_CreateDatetime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.Vw_OrdersWagePaymentRecords(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- //显示人员订单全部收款记录
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 获取订单 前期收款与后期收款 记录
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "3" ? "服务订单" : "其它消费";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- if (dt.Rows[t]["Pay_Category"].ToString().Trim() == "后期收款")
- {
- cell.Value = dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim();
- }
- else
- {
- cell.Value = "前期收款";
- }
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- if (string.IsNullOrEmpty(dt.Rows[t]["Ord_CustomerName1"].ToString().Trim()))
- {
- LYFZ.BLL.BLL_ErpTwoSalesOrder TwoSalesOrderbll = new BLL.BLL_ErpTwoSalesOrder();
- DataTable TwoSalesOrderdt = TwoSalesOrderbll.GetView_TwoSalesOrder(" Tsorder_Number='" + dt.Rows[t]["Pay_OrdNumber"].ToString().Trim() + "'").Tables[0];
- if (TwoSalesOrderdt.Rows.Count > 0)
- {
- cell.Value = TwoSalesOrderdt.Rows[0]["Tsorder_CustomerName"].ToString();
- }
- else { cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim(); }
- }
- else { cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim(); }
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //门市类型
- cell = new DataGridViewTextBoxCell();
- LYFZ.BLL.BLL_ErpOrdersPerson OrdersPersonbll = new BLL.BLL_ErpOrdersPerson();
- DataTable OrdersPersondt = OrdersPersonbll.GetList(" OrdPe_OrderNumber='" + dt.Rows[t]["Pay_OrdNumber"].ToString() + "' and OrdPe_OrdersPerson='" + txtTsorder_OpenSingle.Tag.ToString() + "'").Tables[0];
- if (OrdersPersondt.Rows.Count > 0)
- {
- if (dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款")
- {
- cell.Value = OrdersPersondt.Rows[0]["OrdPe_Type"];
- }
- }
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- #endregion
- dgv1.ClearSelection();
- }
- }
- #endregion
- #region 婚纱版/写真版 检测是否有化妆/摄影工作前期/与二销后期
- #region 摄影
- dt = new DataTable();
- sql = new StringBuilder();
- sql.Append(" (Ordpg_PhotographerId like '%" + Tsorder_OpenSingle + "%' or Ordpg_PhotographyAssistantId like '%" + Tsorder_OpenSingle + "%') and OrdPg_PhotographyStatus='ok' ");
- sql.Append(" and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.View_OrdersWagePaymentRecords_Wedding(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 摄影
- if ((dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款"))
- {
- #region 摄影师也有前期提成(无二销)
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='PhotographerEarlyPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影前期";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- if ((dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim() == "选片二销"))
- {
- #region 摄影师也有选片二销提成
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='PhotographerTwoPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影选片二销";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- #endregion
- }
- }
- #endregion
- #region 化妆
- dt = new DataTable();
- sql = new StringBuilder();
- sql.Append(" (Ordpg_MakeupArtistId like '%" + Tsorder_OpenSingle + "%' or Ordpg_MakeupAssistantId like '%" + Tsorder_OpenSingle + "%') and OrdPg_PhotographyStatus='ok' ");
- sql.Append(" and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.View_OrdersWagePaymentRecords_Wedding(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 化妆
- if ((dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款"))
- {
- #region 化妆师也有前期提成(无二销)
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupEarlyPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆前期";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- if ((dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim() == "选片二销"))
- {
- #region 化妆师也有选片二销提成
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupTwoPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆选片二销";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- #endregion
- }
- }
- #endregion
- #endregion
- #region 儿童版 检测是否有化妆/摄影/引导工作前期/与二销后期
- #region 摄影
- dt = new DataTable();
- sql = new StringBuilder();
- sql.Append(" (Ordpg_Photographer like '%" + Tsorder_OpenSingle + "%' or Ordpg_PhotographyAssistant like '%" + Tsorder_OpenSingle + "%') ");
- sql.Append(" and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.View_OrdersWagePaymentRecords_Child(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 摄影
- if ((dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款"))
- {
- #region 摄影师也有前期提成(无二销)
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='PhotographerEarlyPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影前期";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- if ((dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim() == "选片二销"))
- {
- #region 摄影师也有选片二销提成
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='PhotographerTwoPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "摄影选片二销";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- #endregion
- }
- }
- #endregion
- #region 化妆
- dt = new DataTable();
- sql = new StringBuilder();
- sql.Append(" (Ordpg_MakeupArtist like '%" + Tsorder_OpenSingle + "%' or Ordpg_MakeupAssistant like '%" + Tsorder_OpenSingle + "%') ");
- sql.Append(" and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.View_OrdersWagePaymentRecords_Child(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 化妆
- if ((dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款"))
- {
- #region 化妆师也有前期提成(无二销)
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupEarlyPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆前期";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- if ((dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim() == "选片二销"))
- {
- #region 化妆师也有选片二销提成
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupTwoPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "化妆选片二销";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- #endregion
- }
- }
- #endregion
- #region 引导
- dt = new DataTable();
- sql = new StringBuilder();
- sql.Append(" Ordpg_BootDivision like '%" + Tsorder_OpenSingle + "%' ");
- sql.Append(" and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + " 23:59:59.000')");
- dt = WagesSetBll.View_OrdersWagePaymentRecords_Child(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region 引导
- if ((dt.Rows[t]["Pay_Category"].ToString().Trim() != "后期收款"))
- {
- #region 引导师也有前期提成(无二销)
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupEarlyPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导前期";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- if ((dt.Rows[t]["Pay_TwoPinsCategoryName"].ToString().Trim() == "选片二销"))
- {
- #region 引导师也有选片二销提成
- DataTable dtSystemConfigure = SystemConfigureBll.GetList("Sconfig_Code='MakeupTwoPinsPercentage'").Tables[0];
- if (dtSystemConfigure.Rows.Count > 0)
- {
- if (Convert.ToBoolean(dtSystemConfigure.Rows[0]["Sconfig_IsEnabled"]) == true)
- {
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_OrdNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = (dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单") + "(" + (dt.Rows[t]["Ordpg_Sights"].ToString().Trim()) + ")";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(dt.Rows[t]["Pay_AmountOf"]).ToString("N0");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pay_CreateDatetime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "引导选片二销";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_PaymentMethodName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = "";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pay_CustomNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv1.Rows.Add(dgvr);
- dgv1.ClearSelection();
- }
- }
- #endregion
- }
- #endregion
- }
- }
- #endregion
- #endregion
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message);
- }
- }
- #endregion
- #region 摄影与助理数据源绑定
- public void PhotographyBind()
- {
- try
- {
- dgv2.Rows.Clear();
- LYFZ.BLL.BLL_ErpWagesSet WagesSetBll = new BLL.BLL_ErpWagesSet();
- DataTable dt = new DataTable();
- StringBuilder sql = new StringBuilder();
- sql.Append(" (OrdPg_Photographer like '%" + txtTsorder_OpenSingle.Tag.ToString() + "%' or OrdPg_PhotographyAssistant like '%" + txtTsorder_OpenSingle.Tag.ToString() + "%' or OrdPg_MakeupArtist like '%" + txtTsorder_OpenSingle.Tag.ToString() + "%' or OrdPg_MakeupAssistant like '%" + txtTsorder_OpenSingle.Tag.ToString() + "%' or OrdPg_BootDivision like '%" + txtTsorder_OpenSingle.Tag.ToString() + "%')");
- sql.Append(" and (OrdPg_PhotographyTime>='" + Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd") + "' and OrdPg_PhotographyTime<='" + Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd") + "' and OrdPg_PhotographyStatus='1' and Ord_Class='1')");
- dt = WagesSetBll.Vw_OrdersWagePhotography(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordpg_Number"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- //客户1
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString();
- dgvr.Cells.Add(cell);
- //客户2
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString();
- dgvr.Cells.Add(cell);
- //套系
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString();
- dgvr.Cells.Add(cell);
- //套系价格
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesPrice"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //景点
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_Sights"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //景点级别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Sc_ClassName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //日期
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["OrdPg_PhotographyTime"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- //状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_PhotographyStatusName"].ToString();
- dgvr.Cells.Add(cell);
- //摄影
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_PhotographerName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //摄影助理
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_PhotographyAssistantName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //化妆
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_MakeupArtistName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //化妆助理
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_MakeupAssistantName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //引导师
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_BootDivisionName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_PhotographyCategory"].ToString().Trim();
- dgvr.Cells.Add(cell);
- this.dgv2.Rows.Add(dgvr);
- dgv2.ClearSelection();
- #endregion
- }
- }
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- #endregion
- #region 修片与精修与设计
- public void BindPhoto()
- {
- try
- { //Ord_ClothingNameID='" + txtTsorder_OpenSingle.Tag.ToString() + "' or(Ord_ClothingTime>='" + txtTimeStart.Text + "' and Ord_ClothingTime<='" + txtTimeEnd.Text + " 23:59:59.000') or
- dgv3.Rows.Clear();
- LYFZ.BLL.BLL_ErpWagesSet wagesBll = new BLL.BLL_ErpWagesSet();
- DataTable dt = new DataTable();
- StringBuilder sql = new StringBuilder();
- sql.Append(" ( Ordv_EarlyRepairNameID='" + txtTsorder_OpenSingle.Tag.ToString() + "' or Ordv_DesignerNameID='" + txtTsorder_OpenSingle.Tag.ToString() + "' or Ordv_RefinementNameID='" + txtTsorder_OpenSingle.Tag.ToString() + "')");
- sql.Append(" and ((Ordv_EarlyRepairTime>='" + Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd") + "' and Ordv_EarlyRepairTime<='" + Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd") + " 23:59:59.000' and Ordv_EarlyRepairStatus='ok') or (Ordv_DesignerTime>='" + Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd") + "' and Ordv_DesignerTime<='" + Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd") + " 23:59:59.000' and Ordv_DesignerStatus='ok') or (Ordv_RefinementTime>='" + Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd") + "' and Ordv_RefinementTime<='" + Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd") + " 23:59:59.000' and Ordv_RefinementStatus='ok'))");
- dt = wagesBll.View_OrdersWage(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- //订单号
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Number"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- //客户1
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString();
- dgvr.Cells.Add(cell);
- //客户2
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString();
- dgvr.Cells.Add(cell);
- //套系
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesName"].ToString();
- dgvr.Cells.Add(cell);
- //套系价格
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesPrice"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //套系类别
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_PhotographyCategory"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //景点
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["OrdPg_Sights"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //景点等级
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Sc_ClassName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //服装师
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_ClothingName"].ToString();
- dgvr.Cells.Add(cell);
- //日期1
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_ClothingTime"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //服装状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_ClothingStatus"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //初修师
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_EarlyRepairName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //日期2
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_EarlyRepairTime"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //初修状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_EarlyRepairStatus"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //精修师
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_RefinementName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //日期3
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_RefinementTime"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //精修状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_RefinementStatus"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //设计师
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_DesignerName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //日期4
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_DesignerTime"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //设计状态
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ordv_DesignerStatus"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //选片二销
- cell = new DataGridViewTextBoxCell();
- DataTable dtTwoPie = wagesBll.GetTwoPieSum("Pay_TwoPinsCategoryName='选片二销' and Pay_OrdNumber='" + dt.Rows[t]["Ord_Number"].ToString().Trim() + "'").Tables[0];
- cell.Value = dtTwoPie.Rows[0]["Pay_AmountOf"].ToString() == "" ? "0.00" : dtTwoPie.Rows[0]["Pay_AmountOf"].ToString();
- dgvr.Cells.Add(cell);
- this.dgv3.Rows.Add(dgvr);
- dgv3.ClearSelection();
- #endregion
- }
- }
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- #endregion
- #region 计件提成
- public void BindPiece(string Tsorder_OpenSingle, string TimeStart, string TimeEnd)
- {
- try
- {
- dgv4.Rows.Clear();
- lblPrice.Visible = true;
- decimal Price = 0;
- LYFZ.BLL.BLL_ErpPieceCommissionRecords PieceCommissionRecordsBll = new BLL.BLL_ErpPieceCommissionRecords();
- DataTable dt = new DataTable();
- StringBuilder sql = new StringBuilder();
- sql.Append(" Pcr_DigitalDivision='" + Tsorder_OpenSingle + "'");
- sql.Append(" and (Pcr_Date>='" + TimeStart + "' and Pcr_Date<='" + TimeEnd + " 23:59:59.000')");
- dt = PieceCommissionRecordsBll.Vw_ErpPieceCommissionRecords(sql.ToString()).Tables[0];
- if (dt.Rows.Count > 0)
- {
- for (int t = 0; t < dt.Rows.Count; t++)
- {
- #region
- DataGridViewRow dgvr = new DataGridViewRow();
- DataGridViewCell cell = null;
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pcr_OrderNumber"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //订单类型
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_Type"].ToString().Trim() == "0" ? "婚纱订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "1" ? "儿童订单" : dt.Rows[t]["Ord_Type"].ToString().Trim() == "2" ? "写真订单" : "服务订单";
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName1"].ToString();
- dgvr.Cells.Add(cell);
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_CustomerName2"].ToString();
- dgvr.Cells.Add(cell);
- //提成金额
- LYFZ.BLL.BLL_ErpWageCommissionSet WageCommissionSetbll = new BLL.BLL_ErpWageCommissionSet();
- DataTable dtWageCommissionSet = WageCommissionSetbll.GetList("Wcs_TypeCode='" + dt.Rows[t]["Pcr_CompletionContents"] + "'").Tables[0];
- string Wcs_Percentage = "0";
- if (dtWageCommissionSet.Rows.Count > 0)
- {
- Wcs_Percentage = dtWageCommissionSet.Rows[0]["Wcs_Percentage"].ToString() == "" ? "0" : dtWageCommissionSet.Rows[0]["Wcs_Percentage"].ToString();
- }
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDecimal(Convert.ToDecimal(dt.Rows[t]["Pcr_Quantity"]) * Convert.ToDecimal(Wcs_Percentage)).ToString("N2");
- dgvr.Cells.Add(cell);
- //部门
- cell = new DataGridViewTextBoxCell();
- cell.Value = "数码师";
- dgvr.Cells.Add(cell);
- //内容
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pcr_CompletionContentsName"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //数量
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Pcr_Quantity"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //单价
- cell = new DataGridViewTextBoxCell();
- cell.Value = Wcs_Percentage;
- dgvr.Cells.Add(cell);
- //提成方式
- cell = new DataGridViewTextBoxCell();
- cell.Value = "单价*数量";
- dgvr.Cells.Add(cell);
- //套系价格
- cell = new DataGridViewTextBoxCell();
- cell.Value = dt.Rows[t]["Ord_SeriesPrice"].ToString().Trim();
- dgvr.Cells.Add(cell);
- //日期
- cell = new DataGridViewTextBoxCell();
- cell.Value = Convert.ToDateTime(dt.Rows[t]["Pcr_Date"]).ToString("yyyy-MM-dd");
- dgvr.Cells.Add(cell);
- //合计总和
- decimal ob = Convert.ToDecimal(Convert.ToDecimal(dt.Rows[t]["Pcr_Quantity"]) * Convert.ToDecimal(Wcs_Percentage));
- Price += Convert.ToDecimal(ob.ToString("N2"));
- this.dgv4.Rows.Add(dgvr);
- dgv4.ClearSelection();
- #endregion
- lblPrice.Text = "(总和:" + Price + ")";
- Piece = Price;
- }
- }
- else
- {
- lblPrice.Text = "(总和:0.00)";
- Piece = 0.00m;
- }
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- #endregion
- #endregion
- #region 绑定第二级人员
- /// <summary>
- /// 绑定第二级人员
- /// </summary>
- /// <param name="nodes">TreeView的节点集合</param>
- /// <param name="dataSource">数据源</param>
- /// <param name="parentid"></param>
- private void CreateTreeViewDepartmentUser(TreeNodeCollection nodes, string ClassCode)
- {
- if (ClassCode != "")
- {
- LYFZ.BLL.BLL_ErpUser BLLerpuser = new BLL.BLL_ErpUser();
- DataTable tbl = BLLerpuser.GetList("User_Department='" + ClassCode + "'").Tables[0];
- if (tbl.Rows.Count > 0)
- {
- TreeNode node;
- for (int i = 0; i < tbl.Rows.Count; i++)
- {
- node = new TreeNode();
- node.Text = tbl.Rows[i]["User_Name"].ToString();
- node.Tag = tbl.Rows[i]["User_EmployeeID"].ToString();
- node.Name = tbl.Rows[i]["User_Account"].ToString();
- nodes.Add(node);
- }
- }
- }
- }
- #endregion
- #region 时间控件
- protected override void txtTimeStart_Leave(object sender, EventArgs e)
- {
- if (this.txtTimeStart.Text.Trim() != "")
- {
- if (LYFZ.Command.Command_Validate.IsDateTime(this.txtTimeStart.Text.Trim()) == false)
- {
- this.txtTimeStart.Text = "";
- MessageBoxCustom.Show("开始时间格式输入错误");
- txtTimeStart.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().AddDays(1 - LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().Day)).ToString("yyyy-MM-dd");
- }
- }
- }
- protected override void txtTimeStart_Enter(object sender, EventArgs e)
- {
- if (this.txtTimeStart.Text == "")
- {
- txtTimeStart.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().AddDays(1 - LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime().Day)).ToString("yyyy-MM-dd");
- }
- }
- protected override void txtTimeEnd_Leave(object sender, EventArgs e)
- {
- if (this.txtTimeEnd.Text.Trim() != "")
- {
- if (LYFZ.Command.Command_Validate.IsDateTime(this.txtTimeEnd.Text.Trim()) == false)
- {
- this.txtTimeEnd.Text = "";
- MessageBoxCustom.Show("结束时间格式输入错误");
- txtTimeEnd.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime()).ToString("yyyy-MM-dd");
- }
- }
- }
- protected override void txtTimeEnd_Enter(object sender, EventArgs e)
- {
- if (this.txtTimeEnd.Text == "")
- {
- txtTimeEnd.Text = Convert.ToDateTime(LYFZ.Software.MainBusiness.CommonLogical.SuccessfulLogin.GetServerDateTime()).ToString("yyyy-MM-dd");
- }
- }
- #endregion
- #region 时间查询
- protected override void btnSelect_Click(object sender, EventArgs e)
- {
- WaitForm wf = new WaitForm();
- wf.ShowForm(this);
- try
- {
- if (string.IsNullOrEmpty(txtTsorder_OpenSingle.Text))
- {
- MessageBoxCustom.Show("请选择人员!");
- return;
- }
- dgv1.Rows.Clear();
- dgv2.Rows.Clear();
- dgv3.Rows.Clear();
- dgv4.Rows.Clear();
- if (string.IsNullOrEmpty(txtTimeStart.Text) || string.IsNullOrEmpty(txtTimeEnd.Text))
- {
- MessageBoxCustom.Show("请输入时间!");
- return;
- }
- LYFZ.BLL.BLL_ErpWagesSet wagesBll = new BLL.BLL_ErpWagesSet();
- #region 获取人员基本信息
- DataTable wagesdt = wagesBll.GetList("Ws_StaffCode='" + txtTsorder_OpenSingle.Tag.ToString() + "'").Tables[0];
- if (wagesdt.Rows.Count > 0)
- {
- txtWs_Remark.Text = wagesdt.Rows[0]["Ws_Remark"].ToString();
- txtWs_BasicWage.Text = wagesdt.Rows[0]["Ws_BasicWage"].ToString();
- }
- else
- {
- txtWs_Remark.Text = "";
- txtWs_BasicWage.Text = "0.00";
- }
- #endregion
- #region 获取列表
- //订单,二销提成数据源绑定
- // PaymentBind();
- BindSalarylist(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- //摄影与助理数据源绑定
- PhotographyBind();
- //修片与精修与设计
- BindPhoto();
- //计件提成
- BindPiece(txtTsorder_OpenSingle.Tag.ToString(), Convert.ToDateTime(txtTimeStart.Text).ToString("yyyy-MM-dd"), Convert.ToDateTime(txtTimeEnd.Text).ToString("yyyy-MM-dd"));
- #endregion
- #region 获取工资
- GetWages(txtTsorder_OpenSingle.Tag.ToString());
- #endregion
- wf.CloseForm();
- wf = null;
-
- }
- catch (Exception ex)
- {
- wf.CloseForm();
- wf = null;
-
- MessageBoxCustom.Show(ex.Message);
- }
- }
- #endregion
- #region 获取工资
- /// <summary>
- /// 获取工资
- /// </summary>
- /// <param name="Tsorder_OpenSingle"></param>
- public void GetWages(string Tsorder_OpenSingle)
- {
- try
- {
- LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory();
- LYFZ.BLL.BLL_ErpWagesSet Wagebll = new BLL.BLL_ErpWagesSet();
- LYFZ.BLL.BLL_ErpCommissionPercentage CommissionPercentagebll = new BLL.BLL_ErpCommissionPercentage();
- LYFZ.BLL.BLL_ErpOrdersPhotography OrdersPhotographybll = new BLL.BLL_ErpOrdersPhotography();
- LYFZ.BLL.BLL_ErpWageCommissionSet WageCommissionSetbll = new BLL.BLL_ErpWageCommissionSet();
- LYFZ.BLL.BLL_ErpWagesSet WagesSetbll = new BLL.BLL_ErpWagesSet();
- LYFZ.BLL.BLL_ErpTwoPinsProjectCommissionProportion TwoPinsProjectCommissionProportion = new BLL.BLL_ErpTwoPinsProjectCommissionProportion();
- DataTable dt = new DataTable();
- if (dgv1.Rows.Count > 0)
- {
- for (int i = 0; i < dgv1.Rows.Count; i++)
- {
- string Pay_OrdNumber = dgv1.Rows[i].Cells["Pay_OrdNumber"].Value.ToString();
- decimal Pay_AmountOf = Convert.ToDecimal(dgv1.Rows[i].Cells["Pay_AmountOf"].Value);
- string Pay_Category = dgv1.Rows[i].Cells["Pay_Category"].Value.ToString();
- object OrdPe_Type = dgv1.Rows[i].Cells["OrdPe_Type"].Value;
- string Pay_CustomNumber = dgv1.Rows[i].Cells["Pay_CustomNumber"].Value.ToString();
- #region 获取前期业绩收款记录
- #region 先获取门市提成工资比重(只能在前期收款)
- if (Pay_Category == "前期收款")
- {
- if (OrdPe_Type != null)
- {
- #region
- //获取主门市个数
- decimal MainCount = Convert.ToDecimal(Wagebll.GetPersonCount(" OrdPe_OrderNumber='" + Pay_OrdNumber + "' and OrdPe_Type='0'").Tables[0].Rows[0]["count"]);
- //获取副门市个数
- decimal DeputyCount = Convert.ToDecimal(Wagebll.GetPersonCount(" OrdPe_OrderNumber='" + Pay_OrdNumber + "' and OrdPe_Type='1'").Tables[0].Rows[0]["count"]);
- //获取门市比重
- decimal MainProportion = 0;
- decimal DeputyProportion = 0;
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='MainStoreProportion'").Tables[0].Rows.Count > 0)
- { MainProportion = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='MainStoreProportion'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { MainProportion = 0; }
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyStoreProportion'").Tables[0].Rows.Count > 0)
- { DeputyProportion = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyStoreProportion'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { DeputyProportion = 0; }
- //如果主门市个数只有一个,则按100%比例分配
- if ((MainCount == 1 && DeputyCount == 0))
- {
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Pay_AmountOf.ToString("N0"); ;
- }
- //如果主门市个数只有一个,副门市多个 则按比例分配
- if ((MainCount == 1 && DeputyCount > 0))
- {
- //公式 金额=(总金额/总比例)*门市比重
- if (Convert.ToInt32(OrdPe_Type) == 0) //主
- {
- decimal MsMoney = 0;
- MsMoney = Pay_AmountOf / ((MainCount * MainProportion) + (DeputyCount * DeputyProportion)) * MainProportion;
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = MsMoney.ToString("N0");
- }
- if (Convert.ToInt32(OrdPe_Type) == 1) //副
- {
- decimal MsMoney = 0;
- MsMoney = Pay_AmountOf / ((MainCount * MainProportion) + (DeputyCount * DeputyProportion)) * DeputyProportion;
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = MsMoney.ToString("N0");
- }
- }
- #endregion
- }
- else { dgv1.Rows.RemoveAt(i); }
- }
- #endregion
- #region 获取景点比重
- #region 获取参数与定义参数
- //获取等级级别比重
- decimal OneLevel = 0;
- decimal TwoLevel = 0;
- decimal ThreeLevel = 0;
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADDEBFJDFFC'").Tables[0].Rows.Count > 0)
- { OneLevel = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADDEBFJDFFC'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { OneLevel = 0; }
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADEGBGAFFJC'").Tables[0].Rows.Count > 0)
- { TwoLevel = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADEGBGAFFJC'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { TwoLevel = 0; }
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADAFBHBCHCI'").Tables[0].Rows.Count > 0)
- { ThreeLevel = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='BEBBBCADAFBHBCHCI'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { ThreeLevel = 0; }
- //获取等级级别个数
- decimal OneLevelCount = Convert.ToDecimal(Wagebll.GetAttractionsRatingCount(" Ordpg_Number='" + Pay_OrdNumber + "' and Ordpg_SightsLevel='BEBBBCADDEBFJDFFC'").Tables[0].Rows[0]["count"]);
- decimal TwoLevelCount = Convert.ToDecimal(Wagebll.GetAttractionsRatingCount(" Ordpg_Number='" + Pay_OrdNumber + "' and Ordpg_SightsLevel='BEBBBCADEGBGAFFJC'").Tables[0].Rows[0]["count"]);
- decimal ThreeLevelCount = Convert.ToDecimal(Wagebll.GetAttractionsRatingCount(" Ordpg_Number='" + Pay_OrdNumber + "' and Ordpg_SightsLevel='BEBBBCADAFBHBCHCI'").Tables[0].Rows[0]["count"]);
- #endregion
- #region 摄影前期
- if (Pay_Category == "摄影前期")
- {
- //获取摄影比重
- decimal MainPhotography = 0;
- decimal DeputyPhotography = 0;
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='MainPhotography'").Tables[0].Rows.Count > 0)
- { MainPhotography = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='MainPhotography'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { MainPhotography = 0; }
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyPhotography'").Tables[0].Rows.Count > 0)
- { DeputyPhotography = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyPhotography'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { DeputyPhotography = 0; }
- //多种条件获取工资
- #region 1.如果所以景点阶段都相同
- if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- {
- decimal Attractionswages = 0; //获取景点工资
- //一级
- if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / OneLevelCount);
- //获取摄影人员
- dt = OrdersPhotographybll.GetList("OrdPg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADDEBFJDFFC'").Tables[0];
- }
- //二级
- if ((OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / TwoLevelCount);
- //获取摄影人员
- dt = OrdersPhotographybll.GetList("OrdPg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADEGBGAFFJC'").Tables[0];
- }
- //三级
- if ((OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / ThreeLevelCount);
- //获取摄影人员
- dt = OrdersPhotographybll.GetList("OrdPg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADAFBHBCHCI'").Tables[0];
- }
- if (dt.Rows.Count > 0)
- {
- decimal MainAttractionsPerWages = 0; //主摄影工资
- decimal DeputyAttractionsPerWages = 0; //摄影助理工资
- for (int y = 0; y < dt.Rows.Count; y++)
- {
- string OrdPg_Photographer = dt.Rows[y]["OrdPg_Photographer"].ToString();
- string OrdPg_PhotographyAssistant = dt.Rows[y]["OrdPg_PhotographyAssistant"].ToString();
- //主摄影工资
- if (OrdPg_Photographer == txtTsorder_OpenSingle.Tag.ToString())
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- MainAttractionsPerWages += Attractionswages * (MainPhotography / 100);
- }
- else
- {
- MainAttractionsPerWages += Attractionswages * 1;
- }
- }
- //摄影助理工资
- if (OrdPg_PhotographyAssistant == txtTsorder_OpenSingle.Tag.ToString())
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- DeputyAttractionsPerWages += Attractionswages * (DeputyPhotography / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Attractionswages * 1;
- }
- }
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Convert.ToDecimal(MainAttractionsPerWages + DeputyAttractionsPerWages).ToString("N0");
- }
- }
- }
- #endregion
- #region 2.如果等级不相同
- // if ((OneLevelCount >= 1 && TwoLevelCount >= 1 && ThreeLevelCount >= 1))
- else
- {
- decimal Onej = 0;//一级景点工资
- decimal Twoj = 0; //二级景点工资
- decimal Threej = 0; //三级景点工资
- //获取景点等级总百分比
- decimal AttractionsPercentage = (OneLevelCount * OneLevel) + (TwoLevelCount * TwoLevel) + (ThreeLevelCount * ThreeLevel);
- Onej = Pay_AmountOf / AttractionsPercentage * OneLevel;
- Twoj = Pay_AmountOf / AttractionsPercentage * TwoLevel;
- Threej = Pay_AmountOf / AttractionsPercentage * ThreeLevel;
- //按级别获取工资
- //获取摄影人员
- dt = OrdersPhotographybll.GetList("Ordpg_Number='" + Pay_OrdNumber + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- decimal MainAttractionsPerWages = 0; //主摄影工资
- decimal DeputyAttractionsPerWages = 0; //摄影助理工资
- for (int y = 0; y < dt.Rows.Count; y++)
- {
- string OrdPg_Photographer = dt.Rows[y]["OrdPg_Photographer"].ToString();
- string OrdPg_PhotographyAssistant = dt.Rows[y]["OrdPg_PhotographyAssistant"].ToString();
- string OrdPg_SightsLevel = dt.Rows[y]["OrdPg_SightsLevel"].ToString();
- #region 主摄影工资
- if (OrdPg_Photographer == txtTsorder_OpenSingle.Tag.ToString())
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- MainAttractionsPerWages += Onej * (MainPhotography / 100);
- }
- else
- {
- MainAttractionsPerWages += Onej * 1;
- }
- }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- MainAttractionsPerWages += Twoj * (MainPhotography / 100);
- }
- else
- {
- MainAttractionsPerWages += Twoj * 1;
- }
- }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- MainAttractionsPerWages += Threej * (MainPhotography / 100);
- }
- else
- {
- MainAttractionsPerWages += Threej * 1;
- }
- }
- }
- #endregion
- #region 摄影助理工资
- if (OrdPg_PhotographyAssistant == txtTsorder_OpenSingle.Tag.ToString())
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- DeputyAttractionsPerWages += Onej * (DeputyPhotography / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Onej * 1;
- }
- }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- DeputyAttractionsPerWages += Twoj * (DeputyPhotography / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Twoj * 1;
- }
- }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- {
- if (!string.IsNullOrEmpty(OrdPg_Photographer) && !string.IsNullOrEmpty(OrdPg_PhotographyAssistant))
- {
- DeputyAttractionsPerWages += Threej * (DeputyPhotography / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Threej * 1;
- }
- }
- }
- #endregion
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Convert.ToDecimal(MainAttractionsPerWages + DeputyAttractionsPerWages).ToString("N0");
- }
- }
- }
- #endregion
- }
- #endregion
- #region 化妆前期
- if (Pay_Category == "化妆前期")
- {
- //获取化妆比重
- decimal MainMake = 0;
- decimal DeputyMake = 0;
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='MainMake'").Tables[0].Rows.Count > 0)
- { MainMake = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='MainMake'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { MainMake = 0; }
- if (CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyMake'").Tables[0].Rows.Count > 0)
- { DeputyMake = Convert.ToDecimal(CommissionPercentagebll.GetList("Cp_ProportionCode='DeputyMake'").Tables[0].Rows[0]["Cp_Proportion"]); }
- else { DeputyMake = 0; }
- //多种条件获取工资
- #region 1.如果所以景点阶段都相同
- if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0) || (OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- {
- decimal Attractionswages = 0; //获取景点工资
- //一级
- if ((OneLevelCount >= 1 && TwoLevelCount == 0 && ThreeLevelCount == 0))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / OneLevelCount);
- //获取化妆人员
- dt = OrdersPhotographybll.GetList("Ordpg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADDEBFJDFFC'").Tables[0];
- }
- //二级
- if ((OneLevelCount == 0 && TwoLevelCount >= 1 && ThreeLevelCount == 0))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / TwoLevelCount);
- //获取化妆人员
- dt = OrdersPhotographybll.GetList("Ordpg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADEGBGAFFJC'").Tables[0];
- }
- //三级
- if ((OneLevelCount == 0 && TwoLevelCount == 0 && ThreeLevelCount >= 1))
- {
- //获取景点工资
- Attractionswages = Pay_AmountOf * (100 / 100 / ThreeLevelCount);
- //获取化妆人员
- dt = OrdersPhotographybll.GetList("Ordpg_Number='" + Pay_OrdNumber + "' and OrdPg_SightsLevel='BEBBBCADAFBHBCHCI'").Tables[0];
- }
- if (dt.Rows.Count > 0)
- {
- decimal MainAttractionsPerWages = 0; //主化妆师工资
- decimal DeputyAttractionsPerWages = 0; //化妆助理工资
- for (int y = 0; y < dt.Rows.Count; y++)
- {
- string OrdPg_MakeupArtist = dt.Rows[y]["OrdPg_MakeupArtist"].ToString();
- string OrdPg_MakeupAssistant = dt.Rows[y]["OrdPg_MakeupAssistant"].ToString();
- //主化妆工资
- if (OrdPg_MakeupArtist == txtTsorder_OpenSingle.Tag.ToString())
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- MainAttractionsPerWages += Attractionswages * (MainMake / 100);
- }
- else
- {
- MainAttractionsPerWages += Attractionswages * 1;
- }
- }
- //化妆助理工资
- if (OrdPg_MakeupAssistant == txtTsorder_OpenSingle.Tag.ToString())
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- DeputyAttractionsPerWages += Attractionswages * (DeputyMake / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Attractionswages * 1;
- }
- }
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Convert.ToDecimal(MainAttractionsPerWages + DeputyAttractionsPerWages).ToString("N0");
- }
- }
- }
- #endregion
- #region 2.如果等级不相同
- // if ((OneLevelCount >= 1 && TwoLevelCount >= 1 && ThreeLevelCount >= 1))
- else
- {
- decimal Onej = 0;//一级景点工资
- decimal Twoj = 0; //二级景点工资
- decimal Threej = 0; //三级景点工资
- //获取景点等级总百分比
- decimal AttractionsPercentage = (OneLevelCount * OneLevel) + (TwoLevelCount * TwoLevel) + (ThreeLevelCount * ThreeLevel);
- Onej = Pay_AmountOf / AttractionsPercentage * OneLevel;
- Twoj = Pay_AmountOf / AttractionsPercentage * TwoLevel;
- Threej = Pay_AmountOf / AttractionsPercentage * ThreeLevel;
- //按级别获取工资
- //获取化妆人员
- dt = OrdersPhotographybll.GetList("Ordpg_Number='" + Pay_OrdNumber + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- decimal MainAttractionsPerWages = 0; //主化妆工资
- decimal DeputyAttractionsPerWages = 0; //化妆助理工资
- for (int y = 0; y < dt.Rows.Count; y++)
- {
- string OrdPg_MakeupArtist = dt.Rows[y]["OrdPg_MakeupArtist"].ToString();
- string OrdPg_MakeupAssistant = dt.Rows[y]["OrdPg_MakeupAssistant"].ToString();
- string OrdPg_SightsLevel = dt.Rows[y]["OrdPg_SightsLevel"].ToString();
- #region 主摄影工资
- if (OrdPg_MakeupArtist == txtTsorder_OpenSingle.Tag.ToString())
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- MainAttractionsPerWages += Onej * (MainMake / 100);
- }
- else
- {
- MainAttractionsPerWages += Onej * 1;
- }
- }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- MainAttractionsPerWages += Twoj * (MainMake / 100);
- }
- else
- {
- MainAttractionsPerWages += Twoj * 1;
- }
- }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- MainAttractionsPerWages += Threej * (MainMake / 100);
- }
- else
- {
- MainAttractionsPerWages += Threej * 1;
- }
- }
- }
- #endregion
- #region 摄影助理工资
- if (OrdPg_MakeupAssistant == txtTsorder_OpenSingle.Tag.ToString())
- {
- //一级
- if (OrdPg_SightsLevel == "BEBBBCADDEBFJDFFC")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- DeputyAttractionsPerWages += Onej * (DeputyMake / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Onej * 1;
- }
- }
- //二级
- if (OrdPg_SightsLevel == "BEBBBCADEGBGAFFJC")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- DeputyAttractionsPerWages += Twoj * (DeputyMake / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Twoj * 1;
- }
- }
- //三级
- if (OrdPg_SightsLevel == "BEBBBCADAFBHBCHCI")
- {
- if (!string.IsNullOrEmpty(OrdPg_MakeupArtist) && !string.IsNullOrEmpty(OrdPg_MakeupAssistant))
- {
- DeputyAttractionsPerWages += Threej * (DeputyMake / 100);
- }
- else
- {
- DeputyAttractionsPerWages += Threej * 1;
- }
- }
- }
- #endregion
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Convert.ToDecimal(MainAttractionsPerWages + DeputyAttractionsPerWages).ToString("N0");
- }
- }
- }
- #endregion
- }
- #endregion
- #endregion
- #endregion
- #region 获取后期收款比重
- if (!string.IsNullOrEmpty(Pay_CustomNumber))
- {
- dt = new DataTable();
- dt = TwoPinsProjectCommissionProportion.GetList("Tpc_CustomNumber='" + Pay_CustomNumber + "' and Tpc_OpenSingle='" + Tsorder_OpenSingle + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- decimal Tpc_CommissionPercentage = Convert.ToDecimal(dt.Rows[0]["Tpc_CommissionPercentage"]);
- if (Tpc_CommissionPercentage > 0)
- {
- dgv1.Rows[i].Cells["Pay_AmountOf"].Value = Convert.ToDecimal(Pay_AmountOf * Tpc_CommissionPercentage / 100).ToString("N0");
- }
- else { dgv1.Rows[i].Cells["Pay_AmountOf"].Value = "0"; }
- }
- }
- #endregion
- }
- }
- decimal S_QQYJ = 0; //前期收款业绩
- decimal S_QQYJ_SH = 0; //摄影前期,化妆前期,引导前期业绩
- decimal S_EXYJ = 0; //二销业绩
- decimal S_EXYJ_Tc = 0; //二销提成
- decimal QQSK_TC = 0; //前期收款提成
- decimal QQSK_SH_TC = 0; //摄影,化妆前期,引导前期提成
- string Wcs_TypeCode = ""; //类别代码
- for (int i = 0; i < dgv1.Rows.Count; i++)
- {
- decimal Pay_AmountOf = Convert.ToDecimal(dgv1.Rows[i].Cells["Pay_AmountOf"].Value); //金额
- string Pay_Category = dgv1.Rows[i].Cells["Pay_Category"].Value.ToString(); //类别
- #region 工资各业绩总额
- //前期收款
- if (Pay_Category == "前期收款")
- {
- S_QQYJ += Pay_AmountOf;
- }//摄影前期,化妆前期,引导前期
- else if (Pay_Category == "摄影前期" || Pay_Category == "化妆前期" || Pay_Category == "引导前期")
- {
- S_QQYJ_SH += Pay_AmountOf;
- }
- else
- {
- //二销业绩
- S_EXYJ += Pay_AmountOf;
- }
- #endregion
- #region 获取二销提成
- if (Pay_Category != "前期收款" && Pay_Category != "摄影前期" && Pay_Category != "化妆前期" && Pay_Category != "引导前期")
- {
- dt = SystemCategorybll.GetList("Sc_ClassName='" + Pay_Category + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- Wcs_TypeCode = dt.Rows[0]["Sc_ClassCode"].ToString();
- S_EXYJ_Tc += WageCommissionSetbll.GetCommissionSpecifications(Wcs_TypeCode, Convert.ToDecimal(Pay_AmountOf));
- }
- }
- #endregion
- }
- //前期业绩
- txtEarlyResults.Text = (S_QQYJ + S_QQYJ_SH).ToString("N2");
- //二销业绩
- txtTwoPinsResults.Text = S_EXYJ.ToString("N2");
- //计件提成
- txtPieceCommission.Text = Piece.ToString("N2");
- #region 总工资
- #region 获取前期提成
- dt = Wagebll.GetView_WagesSet("User_EmployeeID='" + Tsorder_OpenSingle + "'").Tables[0];
- if (dt.Rows.Count > 0)
- {
- //获取前期收款提成
- if (!string.IsNullOrEmpty(dt.Rows[0]["Ws_EarlyCommissionScheme"].ToString()))
- {
- Wcs_TypeCode = dt.Rows[0]["Ws_EarlyCommissionScheme"].ToString();
- QQSK_TC = WageCommissionSetbll.GetCommissionSpecifications(Wcs_TypeCode, Convert.ToDecimal(S_QQYJ));
- }
- else { QQSK_TC = 0; }
- //获取摄影,化妆前期,引导前期提成
- if (!string.IsNullOrEmpty(dt.Rows[0]["Ws_PhotographyMakeupCommissionScheme"].ToString()))
- {
- Wcs_TypeCode = dt.Rows[0]["Ws_PhotographyMakeupCommissionScheme"].ToString();
- QQSK_SH_TC = WageCommissionSetbll.GetCommissionSpecifications(Wcs_TypeCode, Convert.ToDecimal(S_QQYJ_SH));
- }
- else { QQSK_SH_TC = 0; }
- }
- #endregion
- #endregion
- //基本工资+前期提成+二销提成+计件提成
- txtTotalWages.Text = Convert.ToDecimal(Convert.ToDecimal(txtWs_BasicWage.Text) + Convert.ToDecimal(QQSK_TC + QQSK_SH_TC) + Convert.ToDecimal(S_EXYJ_Tc) + Convert.ToDecimal(txtPieceCommission.Text)).ToString("N2");
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message);
- }
- }
- #endregion
- #region 排序
- public class RowComparer : System.Collections.IComparer
- {
- private static int sortOrderModifier = 1;
- public RowComparer(SortOrder sortOrder)
- {
- if (sortOrder == SortOrder.Descending)
- {
- sortOrderModifier = -1;
- }
- else if (sortOrder == SortOrder.Ascending)
- {
- sortOrderModifier = 1;
- }
- }
- public int Compare(object x, object y)
- {
- DataGridViewRow DataGridViewRow1 = (DataGridViewRow)x;
- DataGridViewRow DataGridViewRow2 = (DataGridViewRow)y;
- // Try to sort based on the First Cells
- int CompareResult = System.String.Compare(DataGridViewRow1.Cells[0].Value.ToString(), DataGridViewRow2.Cells[0].Value.ToString());
- // If the Last Names are equal, sort based on the Sec. Cells
- if (CompareResult == 0)
- {
- CompareResult = System.String.Compare(DataGridViewRow1.Cells[1].Value.ToString(), DataGridViewRow2.Cells[1].Value.ToString());
- }
- return CompareResult * sortOrderModifier;
- }
- }
- #endregion
- #region 关闭
- protected override void btnClose_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- #endregion
- #region 自动统计
- /// <summary>
- /// 自动统计
- /// </summary>
- /// <param name="Tsorder_OpenSingle"></param>
- /// <param name="TimeStart"></param>
- /// <param name="TimeEnd"></param>
- public void BindAutomaticStatistics(string Tsorder_OpenSingle, string TimeStart, string TimeEnd)
- {
- try
- {
- LYFZ.BLL.BLL_ErpWagesSet wagessetbll = new BLL.BLL_ErpWagesSet();
- DataTable dt = new DataTable();
- #region 获取摄影师与助理
- //摄影师
- dt = wagessetbll.GetPhotographyCount("OrdPg_Photographer like '%" + Tsorder_OpenSingle + "%' and OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "' and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal OrdPg_Photographer = Convert.ToDecimal(dt.Rows[0]["count"]);
- //助理
- dt = wagessetbll.GetPhotographyCount("OrdPg_PhotographyAssistant like '%" + Tsorder_OpenSingle + "%' and OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "' and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal OrdPg_PhotographyAssistant = Convert.ToDecimal(dt.Rows[0]["count"]);
- //化妆师
- dt = wagessetbll.GetPhotographyCount("OrdPg_MakeupArtist like '%" + Tsorder_OpenSingle + "%' and OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "' and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal OrdPg_MakeupArtist = Convert.ToDecimal(dt.Rows[0]["count"]);
- //助理
- dt = wagessetbll.GetPhotographyCount("OrdPg_MakeupAssistant like '%" + Tsorder_OpenSingle + "%' and OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "' and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal OrdPg_MakeupAssistant = Convert.ToDecimal(dt.Rows[0]["count"]);
- //引导师
- dt = wagessetbll.GetPhotographyCount("OrdPg_BootDivision like '%" + Tsorder_OpenSingle + "%' and OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "' and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal OrdPg_BootDivision = Convert.ToDecimal(dt.Rows[0]["count"]);
- //总金额
- dt = wagessetbll.GetPhotographySum("(OrdPg_Photographer like '%" + Tsorder_OpenSingle + "%' or OrdPg_PhotographyAssistant like '%" + Tsorder_OpenSingle + "%' or OrdPg_MakeupArtist like '%" + Tsorder_OpenSingle + "%' or OrdPg_MakeupAssistant like '%" + Tsorder_OpenSingle + "%' or OrdPg_BootDivision like '%" + Tsorder_OpenSingle + "%') and (OrdPg_PhotographyTime>='" + TimeStart + "' and OrdPg_PhotographyTime<='" + TimeEnd + "') and OrdPg_PhotographyStatus='1'").Tables[0];
- decimal Syhe = 0;
- if (!string.IsNullOrEmpty(dt.Rows[0]["he"].ToString()))
- {
- Syhe = Convert.ToDecimal(dt.Rows[0]["he"].ToString());
- }
- else { Syhe = 0; }
- #endregion
- decimal PhotoOrd_SeriesPrice1 = 0;
- decimal SelectionTwoPins1 = 0;
- decimal PhotoOrd_SeriesPrice2 = 0;
- decimal SelectionTwoPins2 = 0;
- decimal PhotoOrd_SeriesPrice3 = 0;
- decimal SelectionTwoPins3 = 0;
- #region 修片与精修与设计
- //修片
- dt = wagessetbll.GetRetouchingCount(" Ordv_EarlyRepairNameID like '%" + Tsorder_OpenSingle + "%' and Ordv_EarlyRepairTime>='" + TimeStart + "' and Ordv_EarlyRepairTime<='" + TimeEnd + " 23:59:59.000' and Ordv_EarlyRepairStatus='1'").Tables[0];
- decimal Ord_EarlyRepairNameID = Convert.ToDecimal(dt.Rows[0]["count"]);
- if (Ord_EarlyRepairNameID > 0)
- {
- if (dgv3.Rows.Count > 0)
- {
- for (int i = 0; i < dgv3.Rows.Count; i++)
- {
- if (dgv3.Rows[i].Cells["PhotoOrd_EarlyRepairStatus"].Value.ToString() == "OK")
- {
- PhotoOrd_SeriesPrice1 += Convert.ToDecimal(dgv3.Rows[i].Cells["PhotoOrd_SeriesPrice"].Value);
- SelectionTwoPins1 += Convert.ToDecimal(dgv3.Rows[i].Cells["SelectionTwoPins"].Value);
- }
- }
- }
- }
- //精修
- dt = wagessetbll.GetRetouchingCount(" Ordv_RefinementNameID like '%" + Tsorder_OpenSingle + "%' and Ordv_RefinementTime>='" + TimeStart + "' and Ordv_RefinementTime<='" + TimeEnd + " 23:59:59.000' and Ordv_RefinementStatus='1'").Tables[0];
- decimal Ord_RefinementNameID = Convert.ToDecimal(dt.Rows[0]["count"]);
- if (Ord_RefinementNameID > 0)
- {
- if (dgv3.Rows.Count > 0)
- {
- for (int i = 0; i < dgv3.Rows.Count; i++)
- {
- if (dgv3.Rows[i].Cells["PhotoOrd_RefinementStatus"].Value.ToString() == "OK")
- {
- PhotoOrd_SeriesPrice2 += Convert.ToDecimal(dgv3.Rows[i].Cells["PhotoOrd_SeriesPrice"].Value);
- SelectionTwoPins2 += Convert.ToDecimal(dgv3.Rows[i].Cells["SelectionTwoPins"].Value);
- }
- }
- }
- }
- //设计
- dt = wagessetbll.GetRetouchingCount(" Ordv_DesignerNameID like '%" + Tsorder_OpenSingle + "%' and Ordv_DesignerTime>='" + TimeStart + "' and Ordv_DesignerTime<='" + TimeEnd + " 23:59:59.000' and Ordv_DesignerStatus='1'").Tables[0];
- decimal Ord_DesignerNameID = Convert.ToDecimal(dt.Rows[0]["count"]);
- if (Ord_DesignerNameID > 0)
- {
- if (dgv3.Rows.Count > 0)
- {
- for (int i = 0; i < dgv3.Rows.Count; i++)
- {
- if (dgv3.Rows[i].Cells["PhotoOrd_DesignerStatus"].Value.ToString() == "OK")
- {
- PhotoOrd_SeriesPrice3 += Convert.ToDecimal(dgv3.Rows[i].Cells["PhotoOrd_SeriesPrice"].Value);
- SelectionTwoPins3 += Convert.ToDecimal(dgv3.Rows[i].Cells["SelectionTwoPins"].Value);
- }
- }
- }
- }
- #endregion
- #region 显示文本
- StringBuilder str = new StringBuilder();
- str.Append("摄影师与助理\r\n");
- str.Append("摄影师:" + OrdPg_Photographer + "\r\n");
- str.Append("助理:" + OrdPg_PhotographyAssistant + "\r\n");
- str.Append("化妆师:" + OrdPg_MakeupArtist + "\r\n");
- str.Append("助理:" + OrdPg_MakeupAssistant + "\r\n");
- str.Append("引导师:" + OrdPg_BootDivision + "\r\n");
- str.Append("订单总金额:" + Syhe + "\r\n");
- str.Append("\r\n");
- str.Append("修片与精修与设计\r\n");
- str.Append("初修:" + Ord_EarlyRepairNameID + "单\r\n");
- str.Append("订单总金额:" + PhotoOrd_SeriesPrice1 + "\r\n");
- str.Append("选片总金额:" + SelectionTwoPins1 + "\r\n");
- str.Append("\r\n");
- str.Append("精修:" + Ord_RefinementNameID + "单\r\n");
- str.Append("订单总金额:" + PhotoOrd_SeriesPrice2 + "\r\n");
- str.Append("选片总金额:" + SelectionTwoPins2 + "\r\n");
- str.Append("\r\n");
- str.Append("设计:" + Ord_DesignerNameID + "单\r\n");
- str.Append("订单总金额:" + PhotoOrd_SeriesPrice3 + "\r\n");
- str.Append("选片总金额:" + SelectionTwoPins3 + "\r\n");
- txtAutomaticStatistics.Text = str.ToString();
- #endregion
- }
- catch (Exception ex)
- {
- MessageBoxCustom.Show(ex.Message);
- }
- }
- #endregion
- #region 导出
- protected override void btnExport4_Click(object sender, EventArgs e)
- {
- try
- {
- this.dgv4.ExportDataTable();
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- protected override void btnExport3_Click(object sender, EventArgs e)
- {
- try
- {
- this.dgv3.ExportDataTable();
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- protected override void btnExport2_Click(object sender, EventArgs e)
- {
- try
- {
- this.dgv2.ExportDataTable();
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- protected override void btnExport1_Click(object sender, EventArgs e)
- {
- try
- {
- this.dgv1.ExportDataTable();
- }
- catch (Exception ex) { MessageBoxCustom.Show(ex.Message); }
- }
- #endregion
- }
- }
|