Exemple #1
0
        public void ASPxGridView1_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e)
        {
            string             id     = e.Values["RMES_ID"].ToString();
            ItemLineSideEntity entity = ItemLineSideFactory.GetByID(id);

            ItemLineSideFactory.Delete(entity);
            e.Cancel = true;
            ASPxGridView1.CancelEdit();
            BindData();
        }
Exemple #2
0
 public bool Delete(ItemLineSideEntity entity)
 {
     try
     {
         db.Delete(entity);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemple #3
0
 public bool Insert(ItemLineSideEntity entity)
 {
     try
     {
         db.Insert("CODE_ITEM_LINESIDE", "RMES_ID", entity);
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Exemple #4
0
 public void ASPxGridView1_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     if (ASPxGridView1.IsNewRowEditing)
     {
         ItemLineSideEntity entity = new ItemLineSideEntity();
         entity.COMPANY_CODE  = theCompanyCode;
         entity.ITEM_CODE     = e.NewValues["ITEM_CODE"].ToString();
         entity.MIN_STOCK_QTY = Convert.ToInt32(e.NewValues["MIN_STOCK_QTY"]);
         entity.STAND_QTY     = Convert.ToInt32(e.NewValues["STAND_QTY"]);
         ASPxComboBox tempComboBox1 = ASPxGridView1.FindEditFormTemplateControl("comLineSideStock") as ASPxComboBox;
         ASPxComboBox tempComboBox2 = ASPxGridView1.FindEditFormTemplateControl("comBatchType") as ASPxComboBox;
         ASPxComboBox tempComboBox3 = ASPxGridView1.FindEditFormTemplateControl("comResourceStore") as ASPxComboBox;
         entity.RESOURCE_STORE      = tempComboBox3.SelectedItem.Value.ToString();
         entity.LINESIDE_STORE_CODE = tempComboBox1.SelectedItem.Value.ToString();
         entity.BATCH_TYPE          = tempComboBox2.SelectedItem.Value.ToString();
         entity.ITEM_NAME           = e.NewValues["ITEM_NAME"].ToString();
         entity.UNIT_CODE           = e.NewValues["UNIT_CODE"].ToString();
         ItemLineSideFactory.Insert(entity);
         e.Cancel = true;
         ASPxGridView1.CancelEdit();
         BindData();
     }
 }
Exemple #5
0
        public void ASPxGridView1_CustomDataCallback(object sender, ASPxGridViewCustomDataCallbackEventArgs e)
        {
            userManager theUserManager = (userManager)Session["theUserManager"];
            string      _ids           = e.Parameters;

            string[] ids = _ids.Split(',');
            //int index = Convert.ToInt32(e.Parameters);
            //string rmesID = ASPxGridView1.GetRowValues(index, "RMES_ID").ToString();


            DB.GetInstance().BeginTransaction();
            try
            {
                string batch_temp = "'B'||TO_CHAR(SYSDATE,'yyyymmdd')||to_char(SEQ_BATCHID.NEXTVAL,'fm0000')";
                string sql        = "select " + batch_temp + " from dual";

                string batch_id = DB.GetInstance().ExecuteScalar <string>(sql);

                DateTime time = DateTime.Now;
                int      num  = 0;


                foreach (var id in ids)
                {
                    ItemLineSideEntity           entity          = ItemLineSideFactory.GetByID(id);
                    ItemLineSideStore2LineEntity tempStoreEntity = new ItemLineSideStore2LineEntity
                    {
                        COMPANY_CODE    = "01",
                        WORKSHOP        = "8101",
                        ITEM_CODE       = entity.ITEM_CODE,
                        ITEM_NAME       = entity.ITEM_NAME,
                        ITEM_QTY        = entity.STAND_QTY,
                        CREATE_TIME     = DateTime.Now,
                        CREATE_USER_ID  = theUserManager.getUserId(),
                        T_LINESIDESTORE = entity.LINESIDE_STORE_CODE,
                        S_LINESIDESTORE = entity.RESOURCE_STORE,
                    };
                    DB.GetInstance().Insert(tempStoreEntity);

                    IMESStore2LineEntity storeEntity = new IMESStore2LineEntity
                    {
                        WERKS  = "8101",
                        AUFNR  = DateTime.Now.ToString("yyyyMMdd").Insert(0, "A000"),
                        SUBMAT = entity.ITEM_CODE,
                        MATKT  = entity.ITEM_NAME,
                        MENGE  = entity.STAND_QTY.ToString(),
                        SLGORT = entity.RESOURCE_STORE,
                        TLGORT = entity.LINESIDE_STORE_CODE,
                        SERIAL = DateTime.Now.ToString("yyyyMMddhhmmss"),
                        WKDT   = time,
                        BATCH  = batch_id,
                        CHARG1 = batch_id,
                        CHARG2 = batch_id,
                        PRIND  = "0"
                    };
                    DB.GetInstance().Insert(storeEntity);
                    num++;
                    SAPMessageTransEntity msgEntity = new SAPMessageTransEntity
                    {
                        MESSAGE_CODE = "0046",
                        WORK_DATE    = DateTime.Now,
                        HANDLE_FLAG  = "0",
                    };
                    DB.GetInstance().Insert(msgEntity);
                }
                string sql1 = "update IMES_DATA_STORE2LINE set KUNNR=" + num + " where BATCH='" + batch_id + "'";
                DB.GetInstance().Execute(sql1);
                DB.GetInstance().CompleteTransaction();
                e.Result = "success";
            }
            catch (Exception ex)
            {
                DB.GetInstance().AbortTransaction();
                e.Result = "false";
            }
        }
Exemple #6
0
 public static bool Delete(ItemLineSideEntity entity)
 {
     return(new ItemLineSideDal().Delete(entity));
 }
Exemple #7
0
 public static bool Update(ItemLineSideEntity entity)
 {
     return(new ItemLineSideDal().Update(entity));
 }
Exemple #8
0
 public static bool Insert(ItemLineSideEntity entity)
 {
     return(new ItemLineSideDal().Insert(entity));
 }