Пример #1
0
        public Boolean Update(string fileName, string text)
        {
            try
            {
                SqlParameter[] sp =
                {
                    new SqlParameter("@Action",                     SqlDbType.NVarChar, 255),
                    new SqlParameter("@Serialkey",                  SqlDbType.Int,        4),
                    new SqlParameter("@Table_Indicator",            SqlDbType.Int,        4),
                    new SqlParameter("@Lsp_Identification",         SqlDbType.Char,       4),
                    new SqlParameter("@Order_Number",               SqlDbType.Char,      17),
                    new SqlParameter("@Order_Type",                 SqlDbType.Char,       4),
                    new SqlParameter("@Supplier_Number",            SqlDbType.Char,       6),
                    new SqlParameter("@Plan_Delivery_Date",         SqlDbType.Date,       3),
                    new SqlParameter("@Warehouse_Number",           SqlDbType.Char,       6),
                    new SqlParameter("@MM_Email_Number",            SqlDbType.Char,       5),
                    new SqlParameter("@Memo_Field",                 SqlDbType.Char,     255),
                    new SqlParameter("@Date_Record",                SqlDbType.Date,       3),
                    new SqlParameter("@Action_Type",                SqlDbType.Char,       1),
                    new SqlParameter("@Commercial_Supplier_Number", SqlDbType.Char,       6),
                    new SqlParameter("@Order_Date",                 SqlDbType.Date,       3),
                    new SqlParameter("@Free_Text1",                 SqlDbType.Char,      20),
                    new SqlParameter("@Free_Text2",                 SqlDbType.Char,      20),
                    new SqlParameter("@EDITDATE",                   SqlDbType.DateTime,   8),
                    new SqlParameter("@FILENAME",                   SqlDbType.NVarChar, 200),
                };
                sp[0].Value = "Update";

                sp[1].Value = this.Serialkey;

                sp[2].Value = this.Table_Indicator;

                sp[3].Value = this.Lsp_Identification;

                sp[4].Value = this.Order_Number;

                sp[5].Value = this.Order_Type;

                sp[6].Value = this.Supplier_Number;

                sp[7].Value = this.Plan_Delivery_Date;

                sp[8].Value = this.Warehouse_Number;

                sp[9].Value = this.MM_Email_Number;

                sp[10].Value = this.Memo_Field;

                sp[11].Value = this.Date_Record;

                sp[12].Value = this.Action_Type;

                sp[13].Value = this.Commercial_Supplier_Number;

                sp[14].Value = this.Order_Date;

                sp[15].Value = this.Free_Text1;

                sp[16].Value = this.Free_Text2;

                sp[17].Value = this.EDITDATE;

                sp[18].Value = this.FILENAME;


                DAL.excutequery(PP_MM_PO_Header, sp, CommandType.StoredProcedure);
                return(true);
            }
            catch (Exception e)
            {
                string category             = "PO_HEADER";
                ResultDatabase_Model result = new ResultDatabase_Model();
                result.HandleError(fileName, text, e.Message.ToString(), this.Order_Number, category);
                return(false);
            }
        }