示例#1
0
        public override void Modify()
        {
            try
            {
                if (this.EditorT != null)
                {
                    DateTime time1 = DateTime.Now;

                    BaseEditor editor = System.Activator.CreateInstance(this.EditorT) as BaseEditor;
                    editor.ShowInTaskbar = false;
                    editor.StartPosition = FormStartPosition.CenterScreen;
                    SM_POCKET obj = gGrid1.GetCurSelect <SM_POCKET>();
                    editor.SetData(obj);
                    var audit = G.Core.ClassHelper.GetFieldValue(obj, AuditField) != null?G.Core.ClassHelper.GetFieldValue(obj, AuditField).ToString() : "";

                    if (audit != "N")
                    {
                        editor.CurEditStatus = EditorStatus.Look;
                    }
                    else
                    {
                        editor.CurEditStatus = EditorStatus.Modify;
                    } DateTime time2 = DateTime.Now;
                    G.AppInfo.GGlobal.SetInfo((time2 - time1).TotalSeconds.ToString());
                    editor.ShowDialog();
                    RefreshData();
                }
            }
            catch (Exception e) { MessageBox.Show(e.Message); }
        }
示例#2
0
 private void Audit()
 {
     try
     {
         SM_POCKET pocket = this.editData as SM_POCKET;
         new G.BLL.ERP.Sale.SM_POCKETLogic().Audit(G.AppInfo.GGlobal.User, pocket);
         MessageBox.Show("审核完成!");
         this.Close();
     }
     catch (Exception e) { MessageBox.Show(e.Message); }
 }
示例#3
0
        public override void gGrid1_DoubleClick(object sender, EventArgs e)
        {
            SM_POCKET pocketobj = this.gGrid1.GetCurSelect <SM_POCKET>();

            if (pocketobj == null)
            {
                return;
            }
            SM_POCKETLOOK oFrm = new SM_POCKETLOOK();

            oFrm.CurEditStatus = EditorStatus.Look;
            oFrm.SetData(pocketobj);
            oFrm.ShowDialog();
            this.RefreshData();
        }
示例#4
0
 private void gGrid1_AfterEdit(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
 {
     if (e.Col == 9)
     {
         SM_POCKET pocket = this.editData as SM_POCKET;
         decimal   total  = 0;
         foreach (SM_POCKETDTL d in pocket.POCKETDTL)
         {
             total += (decimal)d.POCKETQTY;
         }
         pocket.TOTALQTY = total;
         TXT_TOTALQTY.SetValue(total);
         this.gGrid1.Refresh();
     }
 }
示例#5
0
 private void PocketPrint2(bool isprint)
 {
     try
     {
         SM_POCKET pocket    = this.editData as SM_POCKET;
         string    pockid    = G.Core.GConvert.ToString(pocket.POCKID);
         string    condition = string.Format("pockid='{0}'", pockid);
         G.Controls.Printer.PrintHelper printobj = new G.Controls.Printer.PrintHelper(@"\Sale\POCKET2.frx", new List <string>()
         {
             "Master", "Detail"
         }, "pocketprint", condition);
         printobj.Print(isprint);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
示例#6
0
        private void CertPrint2(bool isprint)
        {
            try
            {
                SM_POCKET pocket = this.editData as SM_POCKET;
                string    pockid = G.Core.GConvert.ToString(pocket.POCKID);
                string    sqlstr = string.Format("EXEC SMProc_GetCertData '{0}'", pockid);
                DataSet   ds     = DbEntry.Provider.ExecuteDataset(sqlstr);

                G.Controls.Printer.PrintHelper printobj = new G.Controls.Printer.PrintHelper(@"\Sale\CERTIFICATE2.frx", new List <string>()
                {
                    "Master"
                }, ds);
                printobj.Print(isprint);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
示例#7
0
 private void PocketOut()
 {
     try
     {
         SM_POCKET pocketobj = this.gGrid1.GetCurSelect <SM_POCKET>();
         if (pocketobj == null)
         {
             return;
         }
         int    id   = G.Core.GConvert.ToInt(pocketobj.Id);
         string ckid = BaseExtends.GetNewAutoNo("CK");
         string cker = G.Core.GConvert.ToString(G.AppInfo.GGlobal.User.USERDM);
         DbEntry.UsingTransaction(delegate
         {
             string csql = string.Format("update a set STATUS='O',CKID='{0}',CKDATE=GETDATE(),CKER='{1}' FROM SM_POCKET a where ID={2} ", ckid, cker, id);
             DbEntry.Provider.ExecuteNonQuery(csql);
         });
         this.RefreshData();
     }
     catch (Exception e) { MessageBox.Show(e.Message); }
 }