public ActionResult Edit_data_billing(Billing_maintanence BM) { try { DataSet ds = _objwl.Edit_data_billing(BM); List<Billing_maintanence> Billingmaintanence = new List<Billing_maintanence>(); if (ds.Tables[0].Rows.Count > 0) { ViewBag.fname = ds.Tables[0]; foreach (System.Data.DataRow dr in ViewBag.fname.Rows) { Billingmaintanence.Add(new Billing_maintanence { srno = dr["srno"].ToString(), Corporate = dr["Corporate"].ToString(), BillingName = dr["BillingName"].ToString(), BillingContactPerson = dr["BillingContactPerson"].ToString(), BillingAddress1 = dr["BillingAddress1"].ToString(), BillingAddress2 = dr["BillingAddress2"].ToString(), BillingCity = dr["BillingCity"].ToString(), BillingState = dr["BillingState"].ToString(), BillingCountry = dr["BillingCountry"].ToString(), BillingZipCode = dr["BillingZipCode"].ToString(), BillingEmail = dr["BillingEmail"].ToString(), BillingPhone = dr["BillingPhone"].ToString(), BillingContactMobile = dr["BillingContactMobile"].ToString(), Currency = dr["Currency"].ToString(), SupportMode = dr["SupportMode"].ToString(), FreeSupportPeriod = dr["FreeSupportPeriod"].ToString(), SupportCostPM = dr["SupportCostPM"].ToString(), }); } } var result = Billingmaintanence; return Json(new { Whiteregjs = result }, JsonRequestBehavior.AllowGet); } catch (Exception) { throw; } }
public DataSet Edit_data_billing(Billing_maintanence BM) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("sp_Edit_White_Register_MaintanenceSupport", _cn); _cmd.CommandType = CommandType.StoredProcedure; _cmd.Parameters.AddWithValue("@tablename", "_White_Register_MaintanenceSupport"); _cmd.Parameters.AddWithValue("@Corporate", BM.Corporate); _cmd.Parameters.AddWithValue("@unit", "0"); _cmd.Parameters.AddWithValue("@Formcode", "0"); _cmd.Parameters.AddWithValue("@Formtabcode", "0"); _cmd.Parameters.AddWithValue("@srno", BM.srno); _cmd.Parameters.AddWithValue("@Type", "EditMode"); _cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter _adp = new SqlDataAdapter(_cmd); DataSet _ds = new DataSet(); _adp.Fill(_ds); _adp.Dispose(); _cmd.Dispose(); return _ds; } catch (Exception) { throw; } finally { _cn.Close(); _cn.Dispose(); } }
public ActionResult insert_BillingMaintencae(Billing_maintanence _Billing_maintanence) { try { DataSet ds = _objwl.insert_BillingMaintencae(_Billing_maintanence); if (ds.Tables[0].Rows.Count > 0) { ViewBag.srno = ds.Tables[0].Rows[0]["Srno"]; ViewBag.Message = ds.Tables[0].Rows[0]["msg"]; if (ds.Tables[0].Rows[0]["Help"].ToString() == "Save" || ds.Tables[0].Rows[0]["Help"].ToString() == "Update") { ViewBag.Event = "success"; } else if (ds.Tables[0].Rows[0]["Help"].ToString() == "Duplicate") { ViewBag.Event = "error"; } } return Json(new { srno = ViewBag.srno, Event = ViewBag.Event, responseText = ViewBag.Message }, JsonRequestBehavior.AllowGet); } catch (Exception) { throw; } }
public DataSet insert_BillingMaintencae(Billing_maintanence _Billing_maintanence) { try { _cn.Open(); SqlCommand _cmd = new SqlCommand("sp_save_White_Register_MaintanenceSupport", _cn); _cmd.CommandType = CommandType.StoredProcedure; _cmd.Parameters.AddWithValue("@srno", _Billing_maintanence.srno); _cmd.Parameters.AddWithValue("@Corporate", _Billing_maintanence.Corporate); _cmd.Parameters.AddWithValue("@BillingName", _Billing_maintanence.BillingName); _cmd.Parameters.AddWithValue("@BillingContactPerson", _Billing_maintanence.BillingContactPerson); _cmd.Parameters.AddWithValue("@BillingAddress1", _Billing_maintanence.BillingAddress1); _cmd.Parameters.AddWithValue("@BillingAddress2", _Billing_maintanence.BillingAddress2); _cmd.Parameters.AddWithValue("@BillingCity", _Billing_maintanence.BillingCity); _cmd.Parameters.AddWithValue("@BillingState", _Billing_maintanence.BillingState); _cmd.Parameters.AddWithValue("@BillingCountry", _Billing_maintanence.BillingCountry); _cmd.Parameters.AddWithValue("@BillingZipCode", _Billing_maintanence.BillingZipCode); _cmd.Parameters.AddWithValue("@BillingEmail", _Billing_maintanence.BillingEmail); _cmd.Parameters.AddWithValue("@BillingPhone", _Billing_maintanence.BillingPhone); _cmd.Parameters.AddWithValue("@BillingContactMobile", _Billing_maintanence.BillingContactMobile); _cmd.Parameters.AddWithValue("@Currency", _Billing_maintanence.Currency); _cmd.Parameters.AddWithValue("@SupportMode", _Billing_maintanence.SupportMode); _cmd.Parameters.AddWithValue("@FreeSupportPeriod", _Billing_maintanence.FreeSupportPeriod); _cmd.Parameters.AddWithValue("@SupportCostPM", _Billing_maintanence.SupportCostPM); _cmd.Parameters.AddWithValue("@Attribute1", _Billing_maintanence.Attribute1); _cmd.Parameters.AddWithValue("@Attribute2", _Billing_maintanence.Attribute2); _cmd.Parameters.AddWithValue("@Attribute3", _Billing_maintanence.Attribute3); _cmd.Parameters.AddWithValue("@Attribute4", _Billing_maintanence.Attribute4); _cmd.Parameters.AddWithValue("@Attribute5", _Billing_maintanence.Attribute5); _cmd.Parameters.AddWithValue("@Attribute6", _Billing_maintanence.Attribute6); _cmd.Parameters.AddWithValue("@Attribute7", _Billing_maintanence.Attribute7); _cmd.Parameters.AddWithValue("@Attribute8", _Billing_maintanence.Attribute8); _cmd.Parameters.AddWithValue("@Attribute9", _Billing_maintanence.Attribute9); _cmd.Parameters.AddWithValue("@Attribute10", _Billing_maintanence.Attribute10); _cmd.Parameters.AddWithValue("@CreatedBy", _Billing_maintanence.CreatedBy); _cmd.Parameters.AddWithValue("@CorpcentreBy", _Billing_maintanence.CorpcentreBy); _cmd.Parameters.AddWithValue("@UnitCorpBy", _Billing_maintanence.UnitCorpBy); _cmd.Parameters.AddWithValue("@TerminalBy", _Billing_maintanence.TerminalBy); _cmd.Parameters.AddWithValue("@BranchBy", _Billing_maintanence.BranchBy); SqlDataAdapter adp = new SqlDataAdapter(_cmd); DataSet ds = new DataSet(); adp.Fill(ds); adp.Dispose(); _cmd.Dispose(); return ds; } catch { throw; } finally { _cn.Close(); _cn.Dispose(); } }