Exemple #1
0
        private void Money(ToolStripButton sender)
        {
            if (tabControl1.TabIndex == 0)
            {
                if (mDataGrid1.CurrentRow == null)
                {
                    return;
                }

                Model.Bu_CalSalaryGen salaryGen = mDataGrid1.GetCurrentEntity() as Model.Bu_CalSalaryGen;
                string msg = string.Format("确定要计算:{0}合同编号提成?", salaryGen.Odr_No_Main);
                if (!Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg))
                {
                    return;
                }

                //如果是销售合同,得到输入的指导价
                if (salaryGen.Odr_Type == 1)
                {
                    FmGuidePriceInfo fm = new FmGuidePriceInfo();
                    fm.SelectValue += (obj) =>
                    {
                        decimal value = (decimal)obj;
                        salaryGen.GuidePrice = value;
                    };
                    if (fm.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                }

                NewCalSalary(salaryGen);
            }
            else
            {
                if (mDataGrid2.CurrentRow == null)
                {
                    return;
                }

                Model.Bu_CalSalaryGen salaryGen = mDataGrid2.GetCurrentEntity() as Model.Bu_CalSalaryGen;
                string msg = string.Format("确定重新计算:{0}合同编号提成?", salaryGen.Odr_No_Main);
                if (!Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg))
                {
                    return;
                }

                Model.Info_salary_main oldSalary = manager.FindThe(salaryGen.Odr_No_Main);

                if (salaryGen.Odr_Type == 1)
                {
                    salaryGen.GuidePrice = oldSalary.Guide_Price;
                }

                NewCalSalary(salaryGen);
            }

            Query(null);
        }
Exemple #2
0
        private void Money(ToolStripButton sender)
        {
            if (mDataGridResult.CurrentRow == null)
            {
                return;
            }

            Model.Info_salary_main oldSalary = mDataGridResult.GetCurrentEntity() as Model.Info_salary_main;
            string msg = string.Format("确定重新计算:{0}合同编号提成?", oldSalary.Odr_No_Main);

            if (!Miles.Framework.UI.Function.Dialog.ShowQuestionYesNo(msg))
            {
                return;
            }

            Bu_CalSalaryGen salaryGen = manager.FindTheCalSalaryGenList(oldSalary.Odr_No_Main);

            if (salaryGen.Items.Count == 0)
            {
                salaryGen.Items = manager.GetOrderAllProductItems(salaryGen.Odr_No_Main);
            }

            if (salaryGen.BuildItems.Count == 0)
            {
                salaryGen.BuildItems = manager.GetBuildItems(salaryGen.Odr_No_Main);
            }

            if (salaryGen.FreightItems.Count == 0)
            {
                salaryGen.FreightItems = manager.GetFreightItems(salaryGen.Odr_No_Main);
            }

            if (salaryGen.Odr_Type == 1)
            {
                FmGuidePriceInfo fm = new FmGuidePriceInfo();
                fm.mDecimalInput1.Value = oldSalary.Guide_Price;
                fm.SelectValue         += (obj) =>
                {
                    decimal value = (decimal)obj;
                    salaryGen.GuidePrice = value;
                };
                if (fm.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
            }

            if (NewCalSalary(salaryGen))
            {
                Query(null);
            }
        }