예제 #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            var propertyList = this.FIN_PropertyService.GetListArray(" MyProperty='个性'");
            List <FIN_SpecCost> commCostList = new List <FIN_SpecCost>();

            foreach (var m in propertyList)
            {
                if (!string.IsNullOrEmpty(Request["pro_" + m.Id]))
                {
                    var newM = new FIN_SpecCost();
                    newM.CaiYear    = ddlYear.Text + ddlMonth.Text;
                    newM.CompId     = Convert.ToInt32(ddlCompany.Text);
                    newM.CostTypeId = m.Id;

                    if (CommHelp.VerifesToNum(Request["pro_" + m.Id].ToString()) == false)
                    {
                        base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('数值 格式错误!');</script>");
                        return;
                    }

                    newM.Total  = Convert.ToDecimal(Request["pro_" + m.Id]);
                    newM.UserID = Convert.ToInt32(ddlUser.Text);
                    commCostList.Add(newM);
                }
            }
            FIN_SpecCostService commSer = new FIN_SpecCostService();

            commSer.AddList(commCostList);

            base.ClientScript.RegisterStartupScript(base.GetType(), null, "<script>alert('保存成功!');</script>");
        }