Exemple #1
0
        private String SN;                                 //序列号
        #endregion

        private void btnSave_Press(object sender, EventArgs e)
        {
            try
            {
                if (btnDealMan.Tag == null)
                {
                    throw new Exception("处理人不能为空");
                }
                else
                {
                    ScrapData.SCRAPMAN = btnDealMan.Tag.ToString();          //处理人
                }
                ScrapData.SCRAPDATE   = DatePicker.Value;                    //业务日期
                ScrapData.NOTE        = txtNote.Text;                        //备注
                ScrapData.STATUS      = 0;                                   //维修单状态
                ScrapData.ISSNCONTROL = (Int32)ISSNCONTROL.启用;               //是否属于SN
                ScrapData.CREATEUSER  = Client.Session["UserID"].ToString(); //创建用户
                ScrapData.CREATEDATE  = DateTime.Now;

                List <AssScrapOrderRow> Data = new List <AssScrapOrderRow>();
                if (ListAssetsSN.Rows.Count == 0)
                {
                    throw new Exception("报废行项不能为空!");
                }
                foreach (ListViewRow Row in ListAssetsSN.Rows)
                {
                    frmOrderCreateSNLayout Layout  = Row.Control as frmOrderCreateSNLayout;
                    AssetsOrderRow         RowData = Layout.getData();
                    AssScrapOrderRow       assRow  = new AssScrapOrderRow();

                    assRow.IMAGE      = RowData.IMAGE;
                    assRow.ASSID      = RowData.ASSID;
                    assRow.SN         = RowData.SN;
                    assRow.SCRAPQTY   = RowData.QTY;
                    assRow.LOCATIONID = RowData.LOCATIONID;
                    assRow.STATUS     = RowData.STATUS;
                    assRow.CREATEDATE = DateTime.Now;
                    Data.Add(assRow);
                }
                ScrapData.Rows = Data;
                ReturnInfo r = autofacConfig.assScrapOrderService.AddAssScrapOrder(ScrapData);
                if (r.IsSuccess)
                {
                    ShowResult = ShowResult.Yes;
                    Form.Close();          //创建成功
                    Toast("创建报废单成功!");
                }
                else
                {
                    throw new Exception(r.ErrorInfo);
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Exemple #2
0
        /// <summary>
        /// 创建调拨单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Press(object sender, EventArgs e)
        {
            try
            {
                if (btnDealInMan.Tag == null)
                {
                    throw new Exception("调入管理员不能为空");
                }
                else
                {
                    TransferData.MANAGER = btnDealInMan.Tag.ToString();     //调入管理员
                }
                if (btnLocation.Tag == null)
                {
                    throw new Exception("调入区域不能为空");
                }
                else
                {
                    TransferData.DESLOCATIONID = btnLocation.Tag.ToString();     //调入区域
                }
                if (btnDealMan.Tag == null)
                {
                    throw new Exception("处理人不能为空");
                }
                else
                {
                    TransferData.HANDLEMAN = btnDealMan.Tag.ToString();          //处理人
                }
                TransferData.TRANSFERDATE = DatePicker.Value;                    //维修花费
                TransferData.NOTE         = txtNote.Text;                        //备注
                TransferData.STATUS       = 0;                                   //维修单状态
                TransferData.ISSNCONTROL  = (Int32)ISSNCONTROL.启用;               //是否属于SN
                TransferData.CREATEUSER   = Client.Session["UserID"].ToString(); //创建用户
                TransferData.CREATEDATE   = DateTime.Now;

                List <AssTransferOrderRow> Data = new List <AssTransferOrderRow>();
                if (ListAssetsSN.Rows.Count == 0)
                {
                    throw new Exception("调拨行项不能为空!");
                }
                foreach (ListViewRow Row in ListAssetsSN.Rows)
                {
                    frmOrderCreateSNLayout Layout  = Row.Control as frmOrderCreateSNLayout;
                    AssetsOrderRow         RowData = Layout.getData();
                    AssTransferOrderRow    assRow  = new AssTransferOrderRow();

                    assRow.IMAGE         = RowData.IMAGE;
                    assRow.ASSID         = RowData.ASSID;
                    assRow.INTRANSFERQTY = RowData.QTY;
                    assRow.SN            = RowData.SN;
                    assRow.LOCATIONID    = RowData.LOCATIONID;
                    assRow.STATUS        = RowData.STATUS;
                    assRow.CREATEDATE    = DateTime.Now;
                    Data.Add(assRow);
                }
                TransferData.Rows = Data;
                ReturnInfo r = autofacConfig.assTransferOrderService.AddAssTransferOrder(TransferData, OperateType.资产);
                if (r.IsSuccess)
                {
                    ShowResult = ShowResult.Yes;
                    Form.Close();          //创建成功
                    Toast("创建调拨单成功!");
                }
                else
                {
                    throw new Exception(r.ErrorInfo);
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }
Exemple #3
0
        private String SN;                                 //序列号
        #endregion
        /// <summary>
        /// 创建报修单
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Press(object sender, EventArgs e)
        {
            try
            {
                if (btnDealMan.Tag == null)
                {
                    throw new Exception("处理人不能为空");
                }
                else
                {
                    RepairData.HANDLEMAN = btnDealMan.Tag.ToString();     //处理人
                }
                if (String.IsNullOrEmpty(txtPrice.Text) == false)
                {
                    RepairData.COST = Convert.ToDecimal(txtPrice.Text);   //维修花费
                }
                if (String.IsNullOrEmpty(txtContent.Text))
                {
                    throw new Exception("维修内容不能为空!");
                }
                else
                {
                    RepairData.REPAIRCONTENT = txtContent.Text;               //维修内容
                }
                RepairData.APPLYDATE   = DatePicker.Value;                    //业务日期
                RepairData.NOTE        = txtNote.Text;                        //备注
                RepairData.STATUS      = 0;                                   //维修单状态
                RepairData.ISSNCONTROL = (Int32)ISSNCONTROL.启用;               //是否属于SN
                RepairData.CREATEUSER  = Client.Session["UserID"].ToString(); //创建用户
                RepairData.CREATEDATE  = DateTime.Now;

                List <AssRepairOrderRow> Data = new List <AssRepairOrderRow>();
                if (ListAssetsSN.Rows.Count == 0)
                {
                    throw new Exception("维修行项不能为空!");
                }
                foreach (ListViewRow Row in ListAssetsSN.Rows)
                {
                    frmOrderCreateSNLayout Layout  = Row.Control as frmOrderCreateSNLayout;
                    AssetsOrderRow         RowData = Layout.getData();
                    AssRepairOrderRow      assRow  = new AssRepairOrderRow();

                    assRow.IMAGE         = RowData.IMAGE;
                    assRow.ASSID         = RowData.ASSID;
                    assRow.WAITREPAIRQTY = RowData.QTY;
                    assRow.SN            = RowData.SN;
                    assRow.LOCATIONID    = RowData.LOCATIONID;
                    assRow.STATUS        = RowData.STATUS;
                    assRow.CREATEDATE    = DateTime.Now;
                    Data.Add(assRow);
                }
                RepairData.Rows = Data;
                ReturnInfo r = autofacConfig.assRepairOrderService.AddAssRepairOrder(RepairData);
                if (r.IsSuccess)
                {
                    ShowResult = ShowResult.Yes;
                    Form.Close();          //创建成功
                    Toast("创建维修单成功!");
                }
                else
                {
                    throw new Exception(r.ErrorInfo);
                }
            }
            catch (Exception ex)
            {
                Toast(ex.Message);
            }
        }