Beispiel #1
0
        private void SaveItem()
        {
            ContractCabinetInfo contractCabinetInfo = new ContractCabinetInfo();

            if (InfoID > 0)
            {
                contractCabinetInfo.ContractInfo = Core.Container.Instance.Resolve <IServiceContractInfo>().GetEntity(InfoID);
            }
            //获取新增柜体信息
            contractCabinetInfo.GoodsType    = txtAddress.Text;
            contractCabinetInfo.GoodsName    = txtCostName.Text;
            contractCabinetInfo.GColorOne    = tbColor1.Text;
            contractCabinetInfo.GColorTwo    = tbColor2.Text;
            contractCabinetInfo.GHeight      = decimal.Parse(nbHeight.Text);
            contractCabinetInfo.GWide        = decimal.Parse(nbWide.Text);
            contractCabinetInfo.Remark       = txtRemark.Text;
            contractCabinetInfo.OrderNumber  = decimal.Parse(nbCount.Text);
            contractCabinetInfo.GPrice       = decimal.Parse(nbPrice.Text);
            contractCabinetInfo.SupplyID     = int.Parse(ddlSupply.SelectedValue);
            contractCabinetInfo.GArea        = (contractCabinetInfo.GHeight / 1000) * (contractCabinetInfo.GWide / 1000) * contractCabinetInfo.OrderNumber;
            contractCabinetInfo.OrderAmount  = contractCabinetInfo.GArea * contractCabinetInfo.GPrice;
            contractCabinetInfo.OperatorName = User.Identity.Name;
            //创建柜子设计信息
            Core.Container.Instance.Resolve <IServiceContractCabinetInfo>().Create(contractCabinetInfo);
            //更新合同柜子总金额及合同总金额信息
            UpdateTotalAmount();
            //保存厂家成本信息
            CreateCostInfo();
            //清除多余厂家信息
            CheckCostInfo();
        }
Beispiel #2
0
        /// <summary>
        /// 主材单价及发货数量编辑
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gdCostInfo_AfterEdit(object sender, GridAfterEditEventArgs e)
        {
            Dictionary <int, Dictionary <string, object> > modifiedDict = gdCostInfo.GetModifiedDict();

            foreach (int rowIndex in modifiedDict.Keys)
            {
                //根据绑定列的记录编号,获取发货物品信息和物品基本信息
                int rowID = Convert.ToInt32(gdCostInfo.DataKeys[rowIndex][0]);
                ContractCabinetInfo objInfo = Core.Container.Instance.Resolve <IServiceContractCabinetInfo>().GetEntity(rowID);
                //修改高度
                if (modifiedDict[rowIndex].Keys.Contains("GHeight"))
                {
                    objInfo.GHeight = Convert.ToDecimal(modifiedDict[rowIndex]["GHeight"]);
                }
                //修改宽度
                if (modifiedDict[rowIndex].Keys.Contains("GWide"))
                {
                    objInfo.GWide = Convert.ToDecimal(modifiedDict[rowIndex]["GWide"]);
                }
                //修改数量
                if (modifiedDict[rowIndex].Keys.Contains("OrderNumber"))
                {
                    objInfo.OrderNumber = Convert.ToDecimal(modifiedDict[rowIndex]["OrderNumber"]);
                }
                //修改单价
                if (modifiedDict[rowIndex].Keys.Contains("GPrice"))
                {
                    objInfo.GPrice = Convert.ToDecimal(modifiedDict[rowIndex]["GPrice"]);
                }
                //修改备注
                if (modifiedDict[rowIndex].Keys.Contains("Remark"))
                {
                    objInfo.Remark = modifiedDict[rowIndex]["Remark"].ToString();
                }
                //修改颜色1
                if (modifiedDict[rowIndex].Keys.Contains("GColorOne"))
                {
                    objInfo.GColorOne = modifiedDict[rowIndex]["GColorOne"].ToString();
                }
                //修改颜色2
                if (modifiedDict[rowIndex].Keys.Contains("GColorTwo"))
                {
                    objInfo.GColorTwo = modifiedDict[rowIndex]["GColorTwo"].ToString();
                }

                //更新面积和金额
                objInfo.GArea       = (objInfo.GHeight / 1000) * (objInfo.GWide / 1000) * objInfo.OrderNumber;
                objInfo.OrderAmount = objInfo.GArea * objInfo.GPrice;

                //更新订单明细
                Core.Container.Instance.Resolve <IServiceContractCabinetInfo>().Update(objInfo);
            }
            //更新订单总金额
            UpdateOrderAmount();
            //重新加载订单发货信息
            BindOrderDetail();
        }