public void ChangeClient_ToPotentialClient(string id = "", string Type = "", string Total = "", string Paid = "", string Balance = "", string Cardno = "", string CardExpireyDate = "", string CVV = "", string Phone = "", string Email = "", int Addedby = 0, string comment = "", string SourceComm = "") { int Id = Convert.ToInt32(id); var result = db.NJ_Clients.FirstOrDefault(a => a.Id == Id); result.Payment_Type = Type; if (Total != "") { result.Payment_Total = Convert.ToInt32(Total); } if (Paid != "") { result.Payment_Paid = Convert.ToInt32(Paid); } if (Balance != "") { result.Payment_Balance = Convert.ToInt32(Balance); } result.Payment_Cardno = Cardno; // result.Comment = comment; result.Payment_Card_ExpDate = CardExpireyDate; if (CVV != "") { result.Payment_CVV = Convert.ToInt32(CVV); } result.Phone = Phone; result.Email = Email; result.IsAddedBy = Addedby; result.IsPotentialClient = false; result.MarkClientDate = DateTime.Now; result.SourceOfComm = SourceComm; db.SaveChanges(); var Comments = comment.Trim(); if (Comments != "" && Comments != null) { NJ_tblComment objtblcomment = new NJ_tblComment(); objtblcomment.Comment = comment; objtblcomment.UserId = Id; objtblcomment.Comment_By = Addedby; objtblcomment.Comment_Date = DateTime.Now; db.NJ_tblComment.Add(objtblcomment); db.SaveChanges(); } }
public void UpdateClient(string id = "", string F_Name = "", string LastName = "", string ListType = "", string CourtName = "", string FileDate = "", string CourtDate = "", string Address1 = "", string Address2 = "", string City = "", string State = "", string Zip = "", string Description = "", string MI = "", string Violation = "", string DateIssue = "", string Salutation = "", string Summons = "", string CourtId = "", string Muncipality = "", string Complaint = "", string Title = "", string PaymentType = "", string PaymentTotal = "", string PaymentPaid = "", string PaymentBalance = "", string CardNo = "", string ExpDate = "", string CVV = "", string Email = "", string Phone = "", string DOB = "", string Comment = "", int LoginId = 0, string SourceOfCoummunication = "") { int ids = Convert.ToInt32(id); var result = db.NJ_Clients.FirstOrDefault(a => a.Id == ids); result.SourceOfComm = SourceOfCoummunication; result.F_Name = F_Name; result.L_Name = LastName; result.List_Type = ListType; result.Court_Name = CourtName; result.File_Date = FileDate; result.CourtDate = CourtDate; result.Address1 = Address1; result.Address2 = Address2; result.City = City; result.ST = State; result.ZIP = Zip; result.Description = Description; result.MI = MI; // result.Comment = Comment; result.Violation = Violation; result.DateIssued = DateIssue; result.Salutation = Salutation; result.Summons = Summons; result.NJ_CourtID = CourtId; result.Muncipality = Muncipality; result.Complaint = Complaint; result.Title = Title; result.Payment_Type = PaymentType; result.DOB = DOB; if (PaymentTotal != "") { result.Payment_Total = Convert.ToInt32(PaymentTotal); } if (PaymentPaid != "") { result.Payment_Paid = Convert.ToInt32(PaymentPaid); } if (PaymentBalance != "") { result.Payment_Balance = Convert.ToInt32(PaymentBalance); } result.Payment_Cardno = CardNo; result.Payment_Card_ExpDate = ExpDate; if (CVV != "") { result.Payment_CVV = Convert.ToInt32(CVV); } result.Email = Email; if (Phone != "") { result.Phone = Phone; } db.SaveChanges(); var comments = Comment.Trim(); if (comments != "" && comments != null) { NJ_tblComment objtblcomment = new NJ_tblComment(); objtblcomment.Comment = Comment; objtblcomment.UserId = ids; objtblcomment.Comment_By = LoginId; objtblcomment.Comment_Date = DateTime.Now; db.NJ_tblComment.Add(objtblcomment); db.SaveChanges(); } }
public void MakeClient(string id = "", string Type = "", string Total = "", string Paid = "", string Balance = "", string Cardno = "", string CardExpireyDate = "", string CVV = "", string Phone = "", string Email = "", string PotentialClient = "", string comment = "", int LoginId = 0, string FName = "", string LName = "", string CourtName = "", string Address1 = "", string Address2 = "", string City = "", string State = "", string Zip = "", string Description = "", string DOB = "", string MI = "", string Violation = "", string Dateissued = "", string Salutation = "", string Summons = "", string CourtID = "", string Muncipality = "", string Complaint = "", string Title = "", string ListType = "", string SourceComm = "", string AddedBy = "") { NJTicketEntities db = new NJTicketEntities(); NJ_Clients objNj_Client = new NJ_Clients(); objNj_Client.List_Type = ListType; //objNj_Client.File_Date = result.File_Date; objNj_Client.Court_Name = CourtName; //objNj_Client.CourtDate = CourtDate; objNj_Client.L_Name = LName; objNj_Client.F_Name = FName; objNj_Client.MI = MI; objNj_Client.Address1 = Address1; objNj_Client.Address2 = Address2; objNj_Client.City = City; objNj_Client.ST = State; objNj_Client.ZIP = Zip; objNj_Client.DOB = DOB; objNj_Client.Violation = Violation; objNj_Client.Description = Description; objNj_Client.DateIssued = Dateissued; objNj_Client.Salutation = Salutation; objNj_Client.Summons = Summons; objNj_Client.NJ_CourtID = CourtID; objNj_Client.Muncipality = Muncipality; objNj_Client.Complaint = Complaint; objNj_Client.Title = Title; objNj_Client.Payment_Type = Type; objNj_Client.SourceOfComm = SourceComm; if (Total != "") { objNj_Client.Payment_Total = Convert.ToInt32(Total); } if (Paid != "") { objNj_Client.Payment_Paid = Convert.ToInt32(Paid); } if (Balance != "") { objNj_Client.Payment_Balance = Convert.ToInt32(Balance); } objNj_Client.Payment_Cardno = Cardno; objNj_Client.Payment_Card_ExpDate = CardExpireyDate; objNj_Client.MarkClientDate = DateTime.Now; objNj_Client.Phone = Phone; objNj_Client.Email = Email; if (CVV != "") { objNj_Client.Payment_CVV = Convert.ToInt32(CVV); } int addedBy = Convert.ToInt32(AddedBy); objNj_Client.IsAddedBy = addedBy; objNj_Client.IsPotentialClient = Convert.ToBoolean(PotentialClient); //if (objNj_Client.IsPotentialClient == false) //{ // objNj_Client.IsAddedBy = LoginId; //} // objNj_Client.Comment = comment; db.NJ_Clients.Add(objNj_Client); if (id != "") { int ids = Convert.ToInt32(id); var result = db.NJ_Details.FirstOrDefault(a => a.Id == ids); result.IsUser = true; } db.SaveChanges(); var comments = comment.Trim(); if (comments != "" && comment != null) { var Insertid = objNj_Client.Id; NJ_tblComment objtblcomment = new NJ_tblComment(); objtblcomment.Comment = comment; objtblcomment.UserId = Insertid; objtblcomment.Comment_By = LoginId; objtblcomment.Comment_Date = DateTime.Now; db.NJ_tblComment.Add(objtblcomment); db.SaveChanges(); } }