public void loadInvoice(int ClientID, string val, string size) { switch (size) { case "1": ScriptManager.RegisterStartupScript(this, this.GetType(), "js10", "<script>setSmallFont();</script>", false); break; case "3": ScriptManager.RegisterStartupScript(this, this.GetType(), "js11", "<script>setLargeFont();</script>", false); break; } double total = 0; TblClient obj = new TblClient(ClientID); ltrName.Text = obj.ClientName; ltrContact.Text = obj.Contact; ltrDate.Text = val; string[] date = val.Split('-'); DataTable dt = TblClient.GetVehicleBill(ClientID, date[0], date[1]); rptClientVehicle.DataSource = dt; rptClientVehicle.DataBind(); if (dt.Rows.Count > 0) { ltrTotal.Text = String.Format(Convert.ToInt32(dt.Rows[0]["GrandTotal"]).ToString()); } else { ltrTotal.Text = "0"; } }
private void BindGrid(int ClientID) { SqlParameter[] prm = new SqlParameter[1]; rptClientDetails.DataSource = TblClient.GetAccountDetails(ClientID); rptClientDetails.DataBind(); }
public static void AddClient(ClientsModel model, ServicesModel ModelServices, int postedbyId) { DataContext db = new DataContext(); TblClient tbl = new TblClient(); TblBusinessType tblBusinessType = new TblBusinessType(); tbl.Name = model.Name; tbl.TypeOfCompany = model.TypeOfCompany; tbl.LimitedBy = model.LimitedBy; tbl.ShareValue1 = model.ShareValue1; tbl.ShareValue2 = model.ShareValue2; tbl.ShareCapitalProduct = model.ProductOfShareValues; tbl.BusinessObjectives = model.BusinessObjectives; tbl.CNIC = model.CNIC; tbl.NTN = model.NTN; tbl.PINCode = model.PINCode; tbl.FBRLogin = model.FBRLogin; tbl.FBRPassword = model.FBRPassword; tbl.IncorporationNo = model.IncorporationNo; tbl.RegistrationNo = model.RegistrationNo; tbl.RegisteredWith = model.RegisteredWith; tbl.Address = model.Address; tbl.Email = model.Email; tbl.PhoneNo = model.PhoneNo; tbl.MobileNo = model.MobileNo; tbl.FaxNo = model.FaxNo; tbl.CreatedById = postedbyId; tbl.CreatedDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); tbl.IsActive = true; db.TblClients.InsertOnSubmit(tbl); db.SubmitChanges(); TblService tblServices = new TblService(); var res = (from c in db.TblClients orderby c.Id descending select c).FirstOrDefault(); tbl = res; int currentClientId = tbl.Id; tblServices.ClientId = currentClientId; tblBusinessType.BusinessType = model.BusinessType; tblBusinessType.ClientId = currentClientId; tblServices.Accounting = true ? ModelServices.Accounting == "Accounting" : false; tblServices.Audit = true ? ModelServices.Audit == "Audit" : false; tblServices.Legal = true ? ModelServices.Legal == "Legal" : false; tblServices.Taxation = true ? ModelServices.Taxation == "Taxation" : false; tblServices.Corporate = true ? ModelServices.Corporate == "Corporate" : false; db.TblBusinessTypes.InsertOnSubmit(tblBusinessType); db.TblServices.InsertOnSubmit(tblServices); db.SubmitChanges(); db.Dispose(); //UpdateAndSaveService( ModelServices, currentClientId); }
public AddClientBranchRegisterDTO AddNewCBR(TblStaff staff, TblClient client, TblBranch branch) { // create AddClientBranchRegisterDTO return(new AddClientBranchRegisterDTO { StaffNo = staff.StaffNo, BranchNo = branch.BranchNo, ClientNo = client.ClientNo }); }
public static void UpdatedClient(ClientsModel model, ServicesModel ModelServices, int postedbyId, int ClientId) { DataContext db = new DataContext(); TblClient result = (from c in db.TblClients where c.Id == ClientId select c).Single(); result.Name = model.Name; result.TypeOfCompany = model.TypeOfCompany; result.LimitedBy = model.LimitedBy; result.BusinessObjectives = model.BusinessObjectives; result.ShareValue1 = model.ShareValue1; result.ShareValue2 = model.ShareValue2; result.ShareCapitalProduct = model.ProductOfShareValues; result.CNIC = model.CNIC; result.IncorporationNo = model.IncorporationNo; result.RegistrationNo = model.RegistrationNo; result.RegisteredWith = model.RegisteredWith; result.Address = model.Address; result.Email = model.Email; result.PhoneNo = model.PhoneNo; result.MobileNo = model.MobileNo; result.FaxNo = model.FaxNo; result.UpdatedById = postedbyId; result.UpdatedDate = Convert.ToDateTime(DateTime.Now.ToShortDateString()); db.SubmitChanges(); /****************************************************************************************/ TblService resultServices = (from s in db.TblServices where s.ClientId == ClientId select s).SingleOrDefault(); resultServices.Accounting = true ? ModelServices.Accounting == "Accounting" : false; resultServices.Audit = true ? ModelServices.Audit == "Audit" : false; resultServices.Legal = true ? ModelServices.Legal == "Legal" : false; resultServices.Taxation = true ? ModelServices.Taxation == "Taxation" : false; resultServices.Corporate = true ? ModelServices.Corporate == "Corporate" : false; /***************************************************************************************/ TblBusinessType resultBusinessType = (from b in db.TblBusinessTypes where b.ClientId == ClientId select b).SingleOrDefault(); resultBusinessType.BusinessType = model.BusinessType; db.SubmitChanges(); db.Dispose(); }
protected void lnkEdit_Click(object sender, EventArgs e) { LinkButton ClientID = (LinkButton)sender; TblClient obj = new TblClient(ClientID.CommandArgument); hfClientID.Value = ClientID.CommandArgument; txtName.Text = obj.ClientName; txtContact.Text = obj.Contact; txtCNIC.Text = obj.Cnic; txtLimit.Text = obj.Limit.ToString(); lblPopUpHeading.Text = "Update Client"; ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "openModal('#formPopUp');", true); BindClients(); }
public void loadrptClient() { int amount = 0; DataTable dt = TblClient.GetClients(); rptClientsinfo.DataSource = dt; rptClientsinfo.DataBind(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { amount += Convert.ToInt32(dt.Rows[i]["Remaining"]); } ltrTotal.Text = String.Format("{0:0}", amount); } else { ltrTotal.Text = "0"; } }
protected void btnSave_Click(object sender, EventArgs e) { try { if (IsExist("Tbl_Client", "ClientName,Contact", txtName.Text + "," + txtContact.Text, hfClientID.Value)) { lblmsg.Text = MessageBox.Show(msgDiv, "Record with this contact already exists!", "alert alert-danger alert-icon alert-dismissible", icon, "glyphicon glyphicon-warning-sign"); } else { string msg = "Client detail has been added!"; TblClient obj = new TblClient(); obj.IsNew = true; if (!String.IsNullOrEmpty(hfClientID.Value)) { obj.IsNew = false; obj = new TblClient(hfClientID.Value); msg = "Client detail has been updated!"; } obj.ClientName = txtName.Text; obj.Contact = txtContact.Text; obj.Cnic = txtCNIC.Text; obj.Limit = Convert.ToInt32(txtLimit.Text); obj.IsActive = 1; if (obj.IsNew) { obj.DateX = getDateTime(); } obj.Save(); lblmsg.Text = MessageBox.Show(msgDiv, msg, "alert alert-success alert-icon alert-dismissible", icon, "glyphicon glyphicon-ok-sign"); ClearInputs(Page.Controls); hfClientID.Value = null; lblPopUpHeading.Text = "Add Client"; BindClients(); } } catch { } }
public static List <ClientsModel> ReturnSearchValues(string searchValue) { DataContext db = new DataContext(); TblClient tblClient = new TblClient(); var result = from c in db.TblClients join s in db.TblServices on c.Id equals s.ClientId join b in db.TblBusinessTypes on c.Id equals b.ClientId where c.Name.Contains(searchValue) || string.IsNullOrEmpty(searchValue) || c.CNIC.Contains(searchValue) || string.IsNullOrEmpty(searchValue) || c.IncorporationNo.Contains(searchValue) || string.IsNullOrEmpty(searchValue) || c.RegistrationNo.Contains(searchValue) || string.IsNullOrEmpty(searchValue) || c.Email.Contains(searchValue) || string.IsNullOrEmpty(searchValue) select new ClientsModel { Id = c.Id, Name = c.Name, TypeOfCompany = c.TypeOfCompany, BusinessType = b.BusinessType, LimitedBy = c.LimitedBy, BusinessObjectives = c.BusinessObjectives, ProductOfShareValues = c.ShareCapitalProduct, ServiceAudit = s.Audit, ServiceCorporate = s.Corporate, ServiceAccounting = s.Accounting, ServiceLegal = s.Legal, ServiceTaxation = s.Taxation, CNIC = c.CNIC, IncorporationNo = c.IncorporationNo, RegistrationNo = c.RegistrationNo, RegisteredWith = c.RegisteredWith, Address = c.Address, Email = c.Email, PhoneNo = c.PhoneNo, MobileNo = c.MobileNo, FaxNo = c.FaxNo }; return(result.ToList()); }
protected void lnkDelete_Click(object sender, EventArgs e) { LinkButton ClientID = (LinkButton)sender; string msg = "This client can not be deleted!"; // TblClientAccount obj = new TblClientAccount(ClientID.CommandArgument); //if (String.IsNullOrEmpty(obj.Clientid.ToString())) //{ DataTable dt = ExecutePlainQuery("select * from tbl_ClientAccount where Clientid=" + ClientID.CommandArgument); if (dt.Rows.Count == 0) { TblClient.Delete(ClientID.CommandArgument); msg = "Client has been deleted!"; } else { msg = "This client can not be deleted!"; } lblmsg.Text = MessageBox.Show(msgDiv, msg, "alert alert-danger alert-icon alert-dismissible", icon, "glyphicon glyphicon-warning-sign"); // } BindClients(); }
public void loadInvoice(int ClientID, string val, string VehicleNo, string size) { switch (size) { case "1": ScriptManager.RegisterStartupScript(this, this.GetType(), "js10", "<script>setSmallFont();</script>", false); break; case "3": ScriptManager.RegisterStartupScript(this, this.GetType(), "js11", "<script>setLargeFont();</script>", false); break; } TblClient obj = new TblClient(ClientID); ltrName.Text = obj.ClientName; ltrContact.Text = obj.Contact; ltrDate.Text = val; string[] date = val.Split('-'); DataTable dt = TblClient.GetInvoieDetails(ClientID, date[0], date[1], VehicleNo); rptInvoiceDetails.DataSource = dt; rptInvoiceDetails.DataBind(); if (dt.Rows.Count > 0) { double discount = 0; for (int i = 0; i < dt.Rows.Count; i++) { discount += Convert.ToDouble(dt.Rows[i]["DiscountAmount"]); } ltrTotal.Text = String.Format("{0:0}", (Convert.ToDouble(dt.Rows[0]["Total"]) - discount)); } else { ltrTotal.Text = "0"; } }
public List <ClientDashboardDTO> GetClientDashboard(int userId) { TblClient client = _context.TblClient.FirstOrDefault(x => x.SystemUserNo == userId); if (client == null) { return(null); } var param = new SqlParameter("@ClientNo", client.ClientNo); var dashboard = _context.ClientDashboard.FromSql($"" + $"SELECT re.BranchNo, pr.PropertyNo, pr.MonthlyRent, pr.NumberOfRooms, su.FirstName, su.LastName, su.PhoneNumber " + $"FROM tbl_Registration re " + $"INNER JOIN tbl_Property pr " + $"ON re.BranchNo = re.BranchNo " + $"INNER JOIN tbl_Staff st " + $"ON pr.StaffNo = st.StaffNo " + $"INNER JOIN tbl_SystemUser su " + $"ON st.SystemUserNo = su.SystemUserNo " + $"WHERE re.BranchNo = @ClientNo", param).ToList(); return(dashboard); }
public void loadrptClient(int ClientID, string val, string size) { switch (size) { case "1": ScriptManager.RegisterStartupScript(this, this.GetType(), "js10", "<script>setSmallFont();</script>", false); break; case "3": ScriptManager.RegisterStartupScript(this, this.GetType(), "js11", "<script>setLargeFont();</script>", false); break; } TblClient obj = new TblClient(ClientID); ltrName.Text = obj.ClientName; ltrContact.Text = obj.Contact; string[] date = val.Split('-'); DataTable dt = TblClient.GetMonthlyStatement(ClientID, date[0], date[1]); rptClientsinfo.DataSource = dt; rptClientsinfo.DataBind(); if (dt.Rows.Count > 0) { lblPrv.Text = String.Format("{0:0}", Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["PrevRemaining"])); ltrTotal.Text = String.Format("{0:0}", Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["Remaining"])); lblbalance.Text = String.Format("{0:0}", Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["Balance"])); ltrCash.Text = String.Format("{0:0}", Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["CashPaid"])); ltrQTY.Text = String.Format("{0:0}", Convert.ToInt32(dt.Rows[dt.Rows.Count - 1]["TotalLiters"])); } else { ltrTotal.Text = "0"; lblPrv.Text = "0"; lblbalance.Text = "0"; } }