Example #1
0
    public bool Update()
    {
        bool result = false;

        try
        {
            if (ChkExstUpdateName())
            {
                #region old code
                //SqlParameter[] Params =
                //{
                //    new SqlParameter("@I_CODE",I_CODE),
                //    new SqlParameter("@I_CM_COMP_ID",I_CM_COMP_ID),
                //    new SqlParameter("@I_CAT_CODE",I_CAT_CODE),
                //    new SqlParameter("@I_CODENO",I_CODENO),
                //    new SqlParameter("@I_DRAW_NO",I_DRAW_NO),
                //    new SqlParameter("@I_NAME",I_NAME),
                //    new SqlParameter("@I_MATERIAL",I_MATERIAL),
                //    new SqlParameter("@I_SPECIFICATION",I_SPECIFICATION),
                //    new SqlParameter("@I_ET_CODE",I_ET_CODE),
                //    new SqlParameter("@I_T_ACCT_S",I_T_ACCT_S),
                //    new SqlParameter("@I_T_ACCT_P",I_T_ACCT_P),
                //    new SqlParameter("@I_UOM_CODE",I_UOM_CODE),
                //    new SqlParameter("@I_INV_CAT",I_INV_CAT),
                //    new SqlParameter("@I_MAX_LEVEL",I_MAX_LEVEL),
                //    new SqlParameter("@I_MIN_LEVEL",I_MIN_LEVEL),
                //    new SqlParameter("@I_REORDER_LEVEL",I_REORDER_LEVEL),
                //    new SqlParameter("@I_OP_BAL",I_OP_BAL),
                //    new SqlParameter("@I_OP_BAL_RATE",I_OP_BAL_RATE),
                //    new SqlParameter("@I_STORE_LOC",I_STORE_LOC),
                //    new SqlParameter("@I_INV_RATE",I_INV_RATE),
                //    new SqlParameter("@I_RECEIPT_DATE",I_RECEIPT_DATE),
                //    new SqlParameter("@I_ISSUE_DATE",I_ISSUE_DATE),
                //    new SqlParameter("@I_CURRENT_BAL",I_CURRENT_BAL),
                //    new SqlParameter("@I_ACTIVE_IND",I_ACTIVE_IND),
                //    new SqlParameter("@ES_DELETE",ES_DELETE),
                //    new SqlParameter("@MODIFY",MODIFY),
                //    new SqlParameter("@I_UWEIGHT",I_UWEIGHT),
                //    new SqlParameter("@I_UW_UOM_CODE",I_UW_UOM_CODE),
                //    new SqlParameter("@I_COST_HEAD",I_COST_HEAD)
                //};
                //result = DL_DBAccess.Insertion_Updation_Delete("SP_ITEM_MASTER_Update", Params);
                #endregion

                result = CommonClasses.Execute1("UPDATE ITEM_MASTER SET I_CAT_CODE='" + I_CAT_CODE + "',I_SCAT_CODE='" + I_SCAT_CODE + "',I_CODENO='" + I_CODENO + "',I_DRAW_NO='" + I_DRAW_NO + "',I_NAME='" + I_NAME + "',I_MATERIAL='" + I_MATERIAL + "',I_SPECIFICATION='" + I_SPECIFICATION + "',I_SIZE='" + I_SIZE + "',I_E_CODE='" + I_E_CODE + "',I_ACCOUNT_SALES='" + I_ACCOUNT_SALES + "',I_ACCOUNT_PURCHASE='" + I_ACCOUNT_PURCHASE + "',I_COSTING_HEAD='" + I_COSTING_HEAD + "',I_UOM_CODE='" + I_UOM_CODE + "',I_INV_CAT='" + I_INV_CAT + "',I_ACTIVE_IND='" + I_ACTIVE_IND + "',I_UWEIGHT='" + I_UWEIGHT + "',I_MAX_LEVEL='" + I_MAX_LEVEL + "',I_MIN_LEVEL='" + I_MIN_LEVEL + "', I_REORDER_LEVEL='" + I_REORDER_LEVEL + "',I_OP_BAL='" + I_OP_BAL + "',I_OPEN_RATE='" + I_OP_BAL_RATE + "',I_INV_RATE='" + I_INV_RATE + "',I_STORE_LOC='" + I_STORE_LOC + "',I_RECEIPT_DATE='" + I_RECEIPT_DATE.ToString("dd/MMM/yyyy") + "',I_ISSUE_DATE='" + I_ISSUE_DATE.ToString("dd/MMM/yyyy") + "',I_DENSITY='" + I_DENSITY + "',I_PIGMENT='" + I_PIGMENT + "',I_SOLIDS='" + I_SOLIDS + "',I_VOLATILE='" + I_VOLATILE + "',I_WEIGHT_UOM='" + I_WEIGHT_UOM + "' ,I_DEVELOMENT='" + I_DEVELOMENT + "' ,I_TARGET_WEIGHT='" + I_TARGET_WEIGHT + "' ,I_SUBCAT_CODE='" + I_SUBCAT_CODE + "'   WHERE I_CODE= '" + I_CODE + "'");
            }
            else
            {
                Msg = "Finished Product Already Exist";
            }
        }
        catch (Exception Ex)
        {
            CommonClasses.SendError("inished Product Class", "Update", Ex.Message);
        }
        return(result);
    }
Example #2
0
    public bool Save()
    {
        bool result = false;

        DL_DBAccess = new DatabaseAccessLayer();
        try
        {
            #region old code
            //SqlParameter[] Params =
            //{
            //new SqlParameter("@I_CODE",I_CODE),
            //new SqlParameter("@I_CM_COMP_ID",I_CM_COMP_ID),
            //new SqlParameter("@I_CAT_CODE",I_CAT_CODE),
            //new SqlParameter("@I_CODENO",I_CODENO),
            //new SqlParameter("@I_DRAW_NO",I_DRAW_NO),
            //new SqlParameter("@I_NAME",I_NAME),
            //new SqlParameter("@I_MATERIAL",I_MATERIAL),
            //new SqlParameter("@I_SPECIFICATION",I_SPECIFICATION),
            //new SqlParameter("@I_ET_CODE",I_ET_CODE),
            //new SqlParameter("@I_T_ACCT_S",I_T_ACCT_S),
            //new SqlParameter("@I_T_ACCT_P",I_T_ACCT_P),
            //new SqlParameter("@I_UOM_CODE",I_UOM_CODE),
            //new SqlParameter("@I_INV_CAT",I_INV_CAT),
            //new SqlParameter("@I_MAX_LEVEL",I_MAX_LEVEL),
            //new SqlParameter("@I_MIN_LEVEL",I_MIN_LEVEL),
            //new SqlParameter("@I_REORDER_LEVEL",I_REORDER_LEVEL),
            //new SqlParameter("@I_OP_BAL",I_OP_BAL),
            //new SqlParameter("@I_OP_BAL_RATE",I_OP_BAL_RATE),
            //new SqlParameter("@I_STORE_LOC",I_STORE_LOC),
            //new SqlParameter("@I_INV_RATE",I_INV_RATE),
            //new SqlParameter("@I_RECEIPT_DATE",I_RECEIPT_DATE),
            //new SqlParameter("@I_ISSUE_DATE",I_ISSUE_DATE),
            //new SqlParameter("@I_CURRENT_BAL",I_CURRENT_BAL),
            //new SqlParameter("@I_ACTIVE_IND",I_ACTIVE_IND),
            //new SqlParameter("@ES_DELETE",ES_DELETE),
            //new SqlParameter("@MODIFY",MODIFY),
            //new SqlParameter("@I_UWEIGHT",I_UWEIGHT),
            //new SqlParameter("@I_UW_UOM_CODE",I_UW_UOM_CODE),
            //new SqlParameter("@I_COST_HEAD",I_COST_HEAD)
            //};
            //result = DL_DBAccess.Insertion_Updation_Delete("SP_ITEM_MASTER_Insert", Params);

            #endregion    bool result = false;
            if (CheckExistSaveName())
            {
                string Code = CommonClasses.GetMaxId("Select Max(I_CODE) from ITEM_MASTER");

                result = CommonClasses.Execute1("INSERT INTO ITEM_MASTER(I_CM_COMP_ID,I_CAT_CODE,I_SCAT_CODE,I_CODENO,I_DRAW_NO,I_NAME,I_MATERIAL,I_SPECIFICATION,I_SIZE,I_E_CODE,I_ACCOUNT_SALES,I_ACCOUNT_PURCHASE,I_COSTING_HEAD,I_UOM_CODE,I_INV_CAT,I_ACTIVE_IND,I_UWEIGHT,I_MAX_LEVEL,I_MIN_LEVEL,I_REORDER_LEVEL,I_OP_BAL,I_OPEN_RATE,I_INV_RATE,I_STORE_LOC,I_RECEIPT_DATE,I_ISSUE_DATE,I_DENSITY,I_PIGMENT,I_SOLIDS,I_VOLATILE,I_WEIGHT_UOM,I_DEVELOMENT,I_TARGET_WEIGHT,I_SUBCAT_CODE) VALUES('" + I_CM_COMP_ID + "','" + I_CAT_CODE + "','" + I_SCAT_CODE + "','" + I_CODENO + "','" + I_DRAW_NO + "','" + I_NAME + "','" + I_MATERIAL + "','" + I_SPECIFICATION + "','" + I_SIZE + "','" + I_E_CODE + "','" + I_ACCOUNT_SALES + "','" + I_ACCOUNT_PURCHASE + "','" + I_COSTING_HEAD + "','" + I_UOM_CODE + "','" + I_INV_CAT + "','" + I_ACTIVE_IND + "','" + I_UWEIGHT + "','" + I_MAX_LEVEL + "','" + I_MIN_LEVEL + "','" + I_REORDER_LEVEL + "','" + I_OP_BAL + "','" + I_OP_BAL_RATE + "','" + I_INV_RATE + "','" + I_STORE_LOC + "','" + I_RECEIPT_DATE.ToString("dd/MMM/yyyy") + "','" + I_ISSUE_DATE.ToString("dd/MMM/yyyy") + "','" + I_DENSITY + "','" + I_PIGMENT + "','" + I_SOLIDS + "','" + I_VOLATILE + "','" + I_WEIGHT_UOM + "','" + I_DEVELOMENT + "','" + I_TARGET_WEIGHT + "','" + I_SUBCAT_CODE + "')");
            }
            else
            {
                Msg = "Finished Product Already Exist";
            }
        }

        catch (Exception Ex)
        {
            CommonClasses.SendError("Finished Product Class", "Save", Ex.Message);
        }
        return(result);
    }