public ActionResult Insert_Data_Validation(CommanMasterValidation CMV)
        {
            try
            {
                int result1 = _objCM.insert_data_Validation(CMV);
                if (result1 == 1)
                {
                    ViewBag.Message = "Record Save Sucessfully !";
                }
                return Json(new { success = true, responseText = "Record Save Sucessfully!" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {

                throw;
            }
        }
Пример #2
0
        public int insert_data_Validation(CommanMasterValidation CMV)
        {
            try
            {
                _cn.Open();
                SqlCommand _cmd = new SqlCommand("sp_save_usermaster_validation", _cn);
                _cmd.CommandType = CommandType.StoredProcedure;
                _cmd.Parameters.AddWithValue("@xmaster", CMV.xmaster);
                _cmd.Parameters.AddWithValue("@Field1", CMV.Field1);
                _cmd.Parameters.AddWithValue("@Field2", CMV.Field2);
                _cmd.Parameters.AddWithValue("@Field3", CMV.Field3);
                _cmd.Parameters.AddWithValue("@Field4", CMV.Field4);
                _cmd.Parameters.AddWithValue("@Field5", CMV.Field5);
                _cmd.Parameters.AddWithValue("@Field6", CMV.Field6);
                _cmd.Parameters.AddWithValue("@Field7 ", CMV.Field7);
                _cmd.Parameters.AddWithValue("@Field8", CMV.Field8);
                _cmd.Parameters.AddWithValue("@Field9", CMV.Field9);
                _cmd.Parameters.AddWithValue("@Field10", CMV.Field10);
                _cmd.Parameters.AddWithValue("@Field11", CMV.Field11);
                _cmd.Parameters.AddWithValue("@Field12", CMV.Field12);
                _cmd.Parameters.AddWithValue("@Field13", CMV.Field13);
                _cmd.Parameters.AddWithValue("@Field14", CMV.Field14);
                _cmd.Parameters.AddWithValue("@Field15", CMV.Field15);
                _cmd.Parameters.AddWithValue("@Field16", CMV.Field16);
                _cmd.Parameters.AddWithValue("@Field17", CMV.Field17);
                _cmd.Parameters.AddWithValue("@Field18", CMV.Field18);
                _cmd.Parameters.AddWithValue("@Field19", CMV.Field19);
                _cmd.Parameters.AddWithValue("@Field20", CMV.Field20);
                _cmd.Parameters.AddWithValue("@Language ", CMV.Language);
                _cmd.Parameters.AddWithValue("@Attribute1", CMV.Attribute1);
                _cmd.Parameters.AddWithValue("@Attribute2", CMV.Attribute2);
                _cmd.Parameters.AddWithValue("@Attribute3", CMV.Attribute3);
                _cmd.Parameters.AddWithValue("@Attribute4", CMV.Attribute4);
                _cmd.Parameters.AddWithValue("@Attribute5", CMV.Attribute5);
                _cmd.Parameters.AddWithValue("@Attribute6", CMV.Attribute6);
                _cmd.Parameters.AddWithValue("@Attribute7", CMV.Attribute7);
                _cmd.Parameters.AddWithValue("@Attribute8", CMV.Attribute8);
                _cmd.Parameters.AddWithValue("@Attribute9", CMV.Attribute9);
                _cmd.Parameters.AddWithValue("@Attribute10", CMV.Attribute10);
                _cmd.Parameters.AddWithValue("@Rating1", CMV.Rating1);
                _cmd.Parameters.AddWithValue("@Rating2", CMV.Rating2);
                _cmd.Parameters.AddWithValue("@Rating3", CMV.Rating3);

                _cmd.Parameters.AddWithValue("@Date1", CMV.Date1);
                _cmd.Parameters.AddWithValue("@Date2", CMV.Date2);
                _cmd.Parameters.AddWithValue("@Date3", CMV.Date3);

                _cmd.Parameters.AddWithValue("@Email1", CMV.Email1);
                _cmd.Parameters.AddWithValue("@Email2", CMV.Email2);
                _cmd.Parameters.AddWithValue("@Email3", CMV.Email3);
                _cmd.Parameters.AddWithValue("@Amount", CMV.Amount);
                _cmd.Parameters.AddWithValue("@Amount2", CMV.Amount2);
                _cmd.Parameters.AddWithValue("@Amount3", CMV.Amount3);
                _cmd.Parameters.AddWithValue("@Time1", CMV.Time1);
                _cmd.Parameters.AddWithValue("@Time2", CMV.Time2);
                _cmd.Parameters.AddWithValue("@Html", CMV.Html);
                _cmd.Parameters.AddWithValue("@Upload", CMV.Upload);
                _cmd.Parameters.AddWithValue("@TextArea", CMV.TextArea);
                _cmd.Parameters.AddWithValue("@MultiSelect1", CMV.MultiSelect1);
                _cmd.Parameters.AddWithValue("@MultiSelect2", CMV.MultiSelect2);
                _cmd.Parameters.AddWithValue("@MultiSelect3", CMV.MultiSelect3);
                _cmd.Parameters.AddWithValue("@MultiSelect4", CMV.MultiSelect4);
                _cmd.Parameters.AddWithValue("@MultiSelect5", CMV.MultiSelect5);
                _cmd.Parameters.AddWithValue("@CreatedBy", CMV.CreatedBy);
                if (CMV.EntryDatetime == null)
                {
                    _cmd.Parameters.AddWithValue("@EntryDatetime", DBNull.Value);
                }
                else
                {
                    _cmd.Parameters.AddWithValue("@EntryDatetime", DateTime.ParseExact(CMV.EntryDatetime, "dd/MM/yyyy", null));
                }
                _cmd.Parameters.AddWithValue("@EditedBy", CMV.EditedBy);

                if (CMV.EditDatetime == null)
                {
                    _cmd.Parameters.AddWithValue("@EditDatetime", DBNull.Value);
                }
                else
                {
                    _cmd.Parameters.AddWithValue("@EditDatetime", DateTime.ParseExact(CMV.EditDatetime, "dd/MM/yyyy", null));
                }
                _cmd.Parameters.AddWithValue("@CorpcentreBy", CMV.CorpcentreBy);
                _cmd.Parameters.AddWithValue("@UnitCorpBy", CMV.UnitCorpBy);
                _cmd.Parameters.AddWithValue("@TerminalBy", CMV.TerminalBy);
                int i = _cmd.ExecuteNonQuery();
                return i;
            }
            catch
            {
                throw;
            }
            finally
            {
                _cn.Close();
                _cn.Dispose();
            }
        }