public ActionResult Insert_Data_Caption(CommanMasterCaption CMC)
        {
            try
            {
                int result1 = _objCM.insert_data_Caption(CMC);
                if (result1 == 1)
                {
                }
                return Json(new { success = true, responseText = "Record Save Sucessfully!" }, JsonRequestBehavior.AllowGet);
            }
            catch (Exception)
            {

                throw;
            }
        }
Exemplo n.º 2
0
        public int insert_data_Caption(CommanMasterCaption CMC)
        {
            try
            {
                _cn.Open();
                SqlCommand _cmd = new SqlCommand("sp_save_usermaster_caption", _cn);
                _cmd.CommandType = CommandType.StoredProcedure;
                _cmd.Parameters.AddWithValue("@xmaster", CMC.xmastercaption);
                _cmd.Parameters.AddWithValue("@SEGMENT", CMC.SEGMENTcaption);
                _cmd.Parameters.AddWithValue("@Field1", CMC.Field1caption);
                _cmd.Parameters.AddWithValue("@Field2", CMC.Field2caption);
                _cmd.Parameters.AddWithValue("@Field3", CMC.Field3caption);
                _cmd.Parameters.AddWithValue("@Field4", CMC.Field4caption);
                _cmd.Parameters.AddWithValue("@Field5", CMC.Field5caption);
                _cmd.Parameters.AddWithValue("@Field6", CMC.Field6caption);
                _cmd.Parameters.AddWithValue("@Field7 ", CMC.Field7caption);
                _cmd.Parameters.AddWithValue("@Field8", CMC.Field8caption);
                _cmd.Parameters.AddWithValue("@Field9", CMC.Field9caption);
                _cmd.Parameters.AddWithValue("@Field10", CMC.Field10caption);
                _cmd.Parameters.AddWithValue("@Field11", CMC.Field11caption);
                _cmd.Parameters.AddWithValue("@Field12", CMC.Field12caption);
                _cmd.Parameters.AddWithValue("@Field13", CMC.Field13caption);
                _cmd.Parameters.AddWithValue("@Field14", CMC.Field14caption);
                _cmd.Parameters.AddWithValue("@Field15", CMC.Field15caption);
                _cmd.Parameters.AddWithValue("@Field16", CMC.Field16caption);
                _cmd.Parameters.AddWithValue("@Field17", CMC.Field17caption);
                _cmd.Parameters.AddWithValue("@Field18", CMC.Field18caption);
                _cmd.Parameters.AddWithValue("@Field19", CMC.Field19caption);
                _cmd.Parameters.AddWithValue("@Field20", CMC.Field20caption);
                _cmd.Parameters.AddWithValue("@Language ", CMC.Languagecaption);
                _cmd.Parameters.AddWithValue("@Attribute1", CMC.Attribute1caption);
                _cmd.Parameters.AddWithValue("@Attribute2", CMC.Attribute2caption);
                _cmd.Parameters.AddWithValue("@Attribute3", CMC.Attribute3caption);
                _cmd.Parameters.AddWithValue("@Attribute4", CMC.Attribute4caption);
                _cmd.Parameters.AddWithValue("@Attribute5", CMC.Attribute5caption);
                _cmd.Parameters.AddWithValue("@Attribute6", CMC.Attribute6caption);
                _cmd.Parameters.AddWithValue("@Attribute7", CMC.Attribute7caption);
                _cmd.Parameters.AddWithValue("@Attribute8", CMC.Attribute8caption);
                _cmd.Parameters.AddWithValue("@Attribute9", CMC.Attribute9caption);
                _cmd.Parameters.AddWithValue("@Attribute10", CMC.Attribute10caption);
                _cmd.Parameters.AddWithValue("@Rating1", CMC.Rating1caption);
                _cmd.Parameters.AddWithValue("@Rating2", CMC.Rating2caption);
                _cmd.Parameters.AddWithValue("@Rating3", CMC.Rating3caption);

                _cmd.Parameters.AddWithValue("@Date1", CMC.Date1caption);
                _cmd.Parameters.AddWithValue("@Date2", CMC.Date2caption);
                _cmd.Parameters.AddWithValue("@Date3", CMC.Date3caption);

                _cmd.Parameters.AddWithValue("@Email1", CMC.Email1caption);
                _cmd.Parameters.AddWithValue("@Email2", CMC.Email2caption);
                _cmd.Parameters.AddWithValue("@Email3", CMC.Email3caption);
                _cmd.Parameters.AddWithValue("@Amount", CMC.Amountcaption);
                _cmd.Parameters.AddWithValue("@Amount2", CMC.Amount2caption);
                _cmd.Parameters.AddWithValue("@Amount3", CMC.Amount3caption);
                _cmd.Parameters.AddWithValue("@Time1", CMC.Time1caption);
                _cmd.Parameters.AddWithValue("@Time2", CMC.Time2caption);
                _cmd.Parameters.AddWithValue("@Html", CMC.Htmlcaption);
                _cmd.Parameters.AddWithValue("@Upload", CMC.Uploadcaption);
                _cmd.Parameters.AddWithValue("@TextArea", CMC.TextAreacaption);
                _cmd.Parameters.AddWithValue("@MultiSelect1", CMC.MultiSelect1caption);
                _cmd.Parameters.AddWithValue("@MultiSelect2", CMC.MultiSelect2caption);
                _cmd.Parameters.AddWithValue("@MultiSelect3", CMC.MultiSelect3caption);
                _cmd.Parameters.AddWithValue("@MultiSelect4", CMC.MultiSelect4caption);
                _cmd.Parameters.AddWithValue("@MultiSelect5", CMC.MultiSelect5caption);
                _cmd.Parameters.AddWithValue("@CreatedBy", CMC.CreatedBycaption);
                if (CMC.EntryDatetimecaption == null)
                {
                    _cmd.Parameters.AddWithValue("@EntryDatetime", DBNull.Value);
                }
                else
                {
                    _cmd.Parameters.AddWithValue("@EntryDatetime", DateTime.ParseExact(CMC.EntryDatetimecaption, "dd/MM/yyyy", null));
                }
                _cmd.Parameters.AddWithValue("@EditedBy", CMC.EditedBycaption);

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

        }