コード例 #1
0
 /// <summary>
 /// 修改费用管理
 /// </summary>
 /// <param name="HSSECostUnitManageItem"></param>
 public static void UpdateHSSECostUnitManageItem(Model.CostGoods_HSSECostUnitManageItem HSSECostUnitManageItem)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.CostGoods_HSSECostUnitManageItem newItem = db.CostGoods_HSSECostUnitManageItem.FirstOrDefault(e => e.HSSECostUnitManageItemId == HSSECostUnitManageItem.HSSECostUnitManageItemId);
     if (newItem != null)
     {
         newItem.Type               = HSSECostUnitManageItem.Type;
         newItem.SortIndex          = HSSECostUnitManageItem.SortIndex;
         newItem.ReportTime         = HSSECostUnitManageItem.ReportTime;
         newItem.CostContent        = HSSECostUnitManageItem.CostContent;
         newItem.Quantity           = HSSECostUnitManageItem.Quantity;
         newItem.Metric             = HSSECostUnitManageItem.Metric;
         newItem.Price              = HSSECostUnitManageItem.Price;
         newItem.TotalPrice         = HSSECostUnitManageItem.TotalPrice;
         newItem.AuditQuantity      = HSSECostUnitManageItem.AuditQuantity;
         newItem.AuditPrice         = HSSECostUnitManageItem.AuditPrice;
         newItem.AuditTotalPrice    = HSSECostUnitManageItem.AuditTotalPrice;
         newItem.IsAgree            = HSSECostUnitManageItem.IsAgree;
         newItem.AuditExplain       = HSSECostUnitManageItem.AuditExplain;
         newItem.RatifiedQuantity   = HSSECostUnitManageItem.RatifiedQuantity;
         newItem.RatifiedPrice      = HSSECostUnitManageItem.RatifiedPrice;
         newItem.RatifiedTotalPrice = HSSECostUnitManageItem.RatifiedTotalPrice;
         newItem.RatifiedExplain    = HSSECostUnitManageItem.RatifiedExplain;
         db.SubmitChanges();
     }
 }
コード例 #2
0
        /// <summary>
        /// 确定按钮事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSure_Click(object sender, EventArgs e)
        {
            Model.CostGoods_HSSECostUnitManageItem newItem = new Model.CostGoods_HSSECostUnitManageItem
            {
                HSSECostUnitManageId = this.HSSECostUnitManageId,
                Type        = this.Type,
                SortIndex   = Funs.GetNewInt(this.txtSortIndex.Text.Trim()),
                ReportTime  = Funs.GetNewDateTime(this.txtReportTime.Text),
                CostContent = this.txtCostContent.Text.Trim(),
                Quantity    = Funs.GetNewDecimal(this.txtQuantity.Text),
                Metric      = this.txtMetric.Text.Trim(),
                Price       = Funs.GetNewDecimal(this.txtPrice.Text),
                TotalPrice  = Funs.GetNewDecimal(this.txtTotalPrice.Text),

                AuditQuantity   = Funs.GetNewDecimal(this.txtQuantity.Text),
                AuditPrice      = Funs.GetNewDecimal(this.txtPrice.Text),
                AuditTotalPrice = Funs.GetNewDecimal(this.txtTotalPrice.Text),
            };

            if (!string.IsNullOrEmpty(this.hdHSSECostUnitManageItemId.Text))
            {
                newItem.HSSECostUnitManageItemId = this.hdHSSECostUnitManageItemId.Text;
                BLL.HSSECostUnitManageItemService.UpdateHSSECostUnitManageItem(newItem);
            }
            else
            {
                newItem.HSSECostUnitManageItemId = SQLHelper.GetNewID(typeof(Model.CostGoods_HSSECostUnitManageItem));
                BLL.HSSECostUnitManageItemService.AddHSSECostUnitManageItem(newItem);
            }

            this.InitText();
            this.UpdateHSSECostUnitManage();
            this.BindGrid();
            PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.HSSECostUnitManageId) + "parent.__doPostBack('','HSSECostUnitManageItemWindowClose');");
        }
コード例 #3
0
 /// <summary>
 /// 添加安全费用管理
 /// </summary>
 /// <param name="item"></param>
 public static void AddHSSECostUnitManageItem(Model.CostGoods_HSSECostUnitManageItem item)
 {
     Model.SUBHSSEDB db = Funs.DB;
     Model.CostGoods_HSSECostUnitManageItem newItem = new Model.CostGoods_HSSECostUnitManageItem
     {
         HSSECostUnitManageItemId = item.HSSECostUnitManageItemId,
         HSSECostUnitManageId     = item.HSSECostUnitManageId,
         Type               = item.Type,
         SortIndex          = item.SortIndex,
         ReportTime         = item.ReportTime,
         CostContent        = item.CostContent,
         Quantity           = item.Quantity,
         Metric             = item.Metric,
         Price              = item.Price,
         TotalPrice         = item.TotalPrice,
         AuditQuantity      = item.AuditQuantity,
         AuditPrice         = item.AuditPrice,
         AuditTotalPrice    = item.AuditTotalPrice,
         IsAgree            = item.IsAgree,
         AuditExplain       = item.AuditExplain,
         RatifiedQuantity   = item.RatifiedQuantity,
         RatifiedPrice      = item.RatifiedPrice,
         RatifiedTotalPrice = item.RatifiedTotalPrice,
         RatifiedExplain    = item.RatifiedExplain,
     };
     db.CostGoods_HSSECostUnitManageItem.InsertOnSubmit(newItem);
     db.SubmitChanges();
 }