Пример #1
0
 private void btAddKuCun_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
 {
     PJ_gdscrk pj = gridView1.GetFocusedRow() as PJ_gdscrk;
     frmGDSCKEdit edit = new frmGDSCKEdit();
     if (pj != null)
     {
         edit.RowData = pj;
     }
     edit.ShowDialog();
 }
Пример #2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (lkeGDS.EditValue == null) return;

            frmGDSCKEdit frm = new frmGDSCKEdit();
            PJ_gdscrk wp = gridView1.GetFocusedRow() as PJ_gdscrk;

            if (wp == null || Convert.ToInt32(wp.kcsl) <= 0)
            {
                wp = new PJ_gdscrk();
            }
            IList<PJ_gdscrk> pnumli = Client.ClientHelper.PlatformSqlMap.GetListByWhere
            <PJ_gdscrk>(" where id like '%" + DateTime.Now.ToString("yyyyMMdd") + "%' order by id desc");
            if (pnumli.Count == 0)
                wp.num = "GDSCRK" + DateTime.Now.ToString("yyyyMMdd") + string.Format("{0:D4}", 1);
            else
            {
                wp.num = "GDSCRK" + (Convert.ToDecimal(pnumli[0].num.Replace("GDSCRK", "")) + 1);
            }
            wp.type = "出库";
            wp.OrgCode = lkeGDS.EditValue.ToString();
            frm.RowData = wp;
            frm.isSet = true;
            frm.ShowDialog();
        }