public ActionResult Confirm(VarianceEditModel model)
        {
            try
            {
                var user = AccountHelper.GetLoginUserInfo(HttpContext.User.Identity);
                model.LoginName = user.LoginName;
                model.EditType = 2;
                model.CustomerCode = user.CustomerCode;

                string message = OrderVarianceManager.Instance.Edit(model);
                if (!String.IsNullOrEmpty(message))
                {
                    TempData["Error"] = message;
                    return View("Error");
                }
                return RedirectToAction("index");
            }
            catch (Exception ex)
            {
                TempData["Error"] = ex.ToString();
                return View("Error");
            }
        }
        public static string Edit(VarianceEditModel model)
        {
            SqlParameter[] parameters = new SqlParameter[31];
            parameters[0] = new SqlParameter("@lx", SqlDbType.SmallInt);
            parameters[0].Value = model.EditType;
            parameters[1] = new SqlParameter("@tGuid", SqlDbType.VarChar);
            parameters[1].Value = model.TGuid;
            parameters[2] = new SqlParameter("@khh", SqlDbType.VarChar);
            parameters[2].Value = model.CustomerCode;
            parameters[3] = new SqlParameter("@xh", SqlDbType.VarChar);
            parameters[3].Value = model.ModelNo;
            parameters[4] = new SqlParameter("@htbh", SqlDbType.VarChar);
            parameters[4].Value = model.OldHtbh;
            parameters[5] = new SqlParameter("@czr", SqlDbType.VarChar);
            parameters[5].Value = model.LoginName;
            parameters[6] = new SqlParameter("@fhrq", SqlDbType.Date);
            parameters[6].Value = model.SendDate;
            parameters[7] = new SqlParameter("@bundleNo", SqlDbType.VarChar);
            parameters[7].Value = model.BundleNo;
            parameters[8] = new SqlParameter("@bn", SqlDbType.VarChar);
            parameters[8].Value = model.OldBundleNo;
            parameters[9] = new SqlParameter("@id", SqlDbType.Int);
            parameters[9].Value = model.Id;
            parameters[10] = new SqlParameter("@s1", SqlDbType.Int);
            parameters[10].Value = model.Size1;
            parameters[11] = new SqlParameter("@s2", SqlDbType.Int);
            parameters[11].Value = model.Size2;
            parameters[12] = new SqlParameter("@s3", SqlDbType.Int);
            parameters[12].Value = model.Size3;
            parameters[13] = new SqlParameter("@s4", SqlDbType.Int);
            parameters[13].Value = model.Size4;
            parameters[14] = new SqlParameter("@s5", SqlDbType.Int);
            parameters[14].Value = model.Size5;
            parameters[15] = new SqlParameter("@s6", SqlDbType.Int);
            parameters[15].Value = model.Size6;
            parameters[16] = new SqlParameter("@s7", SqlDbType.Int);
            parameters[16].Value = model.Size7;
            parameters[17] = new SqlParameter("@s8", SqlDbType.Int);
            parameters[17].Value = model.Size8;
            parameters[18] = new SqlParameter("@s9", SqlDbType.Int);
            parameters[18].Value = model.Size9;
            parameters[19] = new SqlParameter("@s10", SqlDbType.Int);
            parameters[19].Value = model.Size10;
            parameters[20] = new SqlParameter("@s11", SqlDbType.Int);
            parameters[20].Value = model.Size11;
            parameters[21] = new SqlParameter("@s12", SqlDbType.Int);
            parameters[21].Value = model.Size12;
            parameters[22] = new SqlParameter("@s13", SqlDbType.Int);
            parameters[22].Value = model.Size13;
            parameters[23] = new SqlParameter("@s14", SqlDbType.Int);
            parameters[23].Value = model.Size14;
            parameters[24] = new SqlParameter("@s15", SqlDbType.Int);
            parameters[24].Value = model.Size15;
            parameters[25] = new SqlParameter("@s16", SqlDbType.Int);
            parameters[25].Value = model.Size16;
            parameters[26] = new SqlParameter("@s17", SqlDbType.Int);
            parameters[26].Value = model.Size17;
            parameters[27] = new SqlParameter("@s18", SqlDbType.Int);
            parameters[27].Value = model.Size18;
            parameters[28] = new SqlParameter("@s19", SqlDbType.Int);
            parameters[28].Value = model.Size19;
            parameters[29] = new SqlParameter("@s20", SqlDbType.Int);
            parameters[29].Value = model.Size20;
            parameters[30] = new SqlParameter("@message", SqlDbType.VarChar);
            parameters[30].Size = 500;
            parameters[30].Direction = ParameterDirection.InputOutput;

            SqlHelper.ExecuteNonQuery(ConnectionHelper.ConnectionString
               , CommandType.StoredProcedure
               , "spr_khys_ovrN"
               , parameters);

            return parameters[30].Value.ToString();

        }
Ejemplo n.º 3
0
 public string Edit(VarianceEditModel model)
 {
     return OrderVarianceDataProvider.Edit(model);
 }