protected void Page_Load(object sender, EventArgs e) { try { DataTable dt = new DataTable(); Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions(); dt = fin.GetAccountGroups(CPublic.GetCompanyID()); if (dt != null) { foreach (DataRow item in dt.Rows) { ListItem items = new ListItem(item["name"].ToString(), item["id"].ToString()); ddlAccountGroups.Items.Add(items); } } dt = fin.GetAccountHeads(Convert.ToInt32(ddlAccountGroups.SelectedValue)); if (dt != null) { foreach (DataRow item in dt.Rows) { ListItem items = new ListItem(item["Fah_Name"].ToString(), item["Fah_ID"].ToString()); ddlTransHead.Items.Add(items); } } } catch (Exception ex) { } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { //Initilization at Pageload ddlTransHead.LoadAccountHeads(CPublic.GetCompanyID()); Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions(); DateTime newDate = new DateTime(DateTime.UtcNow.Year, DateTime.UtcNow.Month, 1);//From date(First day of the current month) txtFromDate.Text = newDate.ToString("dd-MMM-yyyy"); txtToDate.Text = DateTime.UtcNow.ToString("dd-MMM-yyyy"); ddlCostCenter.LoadCost(CPublic.GetCompanyID()); ddlTransHead.SelectedValue = "6"; if (ddlTransHead.SelectedValue != "0") { lblLedgerHead.InnerText = ddlTransHead.SelectedItem.Text; } else { lblLedgerHead.InnerText = "Cash"; } lblDate.InnerText = "From " + txtFromDate.Text + " to " + txtToDate.Text; literalGrid.Text = fin.BindGrid(hiddenChildId.Value, ddlChildHead.SelectedValue, ddlTransHead.SelectedValue, txtFromDate.Text, txtToDate.Text, ddlCostCenter.SelectedValue); } catch (Exception) { } } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Product product = new Product(); product.ItemID = Convert.ToInt32(hdItemId.Value); product.Name = txtItemName.Text.Trim(); product.UnitID = Convert.ToInt32(ddlUOM.SelectedValue); product.TaxId = Convert.ToInt32(ddlTax.SelectedValue); product.Description = txtDescription.Text.Trim(); product.ItemCode = txtItemCode.Text.Trim(); product.OEMCode = txtOEM.Text.Trim(); product.HSCode = txtHSCode.Text.Trim(); product.Barcode = txtBarcode.Text.Trim(); product.TypeID = Convert.ToInt32(ddlType.SelectedValue); product.MRP = Convert.ToDecimal(txtMrp.Text); product.CostPrice = Convert.ToDecimal(txtCost.Text); product.SellingPrice = Convert.ToDecimal(txtSell.Text); //product.Remarks = txtRemarks.Text.Trim(); product.CategoryID = Convert.ToInt32(ddlCategory.SelectedValue); product.GroupID = Convert.ToInt32(ddlGroup.SelectedValue); product.BrandID = Convert.ToInt32(ddlBrand.SelectedValue); product.CompanyId = CPublic.GetCompanyID(); product.CreatedBy = CPublic.GetuserID(); product.ModifiedBy = CPublic.GetuserID(); product.Status = Convert.ToInt32(ddlStatus.SelectedValue); OutputMessage result = null; if (product.ItemID == 0) { result = product.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "')", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true); } } else { result = product.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "')", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + ex.Message + "')", true); } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlAccountGroup.LoadAccountGroups(CPublic.GetCompanyID()); } }
protected void Page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlDept.LoadDepartments(CPublic.GetCompanyID()); } }
protected void Page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlEmpName.LoadEmployee(CPublic.GetCompanyID()); ddlLoc.LoadLocations(CPublic.GetCompanyID()); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Payroll.OfficeShift off = new Entities.Payroll.OfficeShift(); off.ID = Convert.ToInt32(hdId.Value); off.Name = txtName.Text.Trim(); off.MondayInTime = Convert.ToDateTime(txtMonClockIn.Text); off.MondayOutTime = Convert.ToDateTime(txtMonClockOut.Text); off.TuesdayInTime = Convert.ToDateTime(txtTueClockIn.Text); off.TuesdayOutTime = Convert.ToDateTime(txtTueClockOut.Text); off.WednesdayInTime = Convert.ToDateTime(txtWedClockIn.Text); off.WednesdayOutTime = Convert.ToDateTime(txtWedClockOut.Text); off.ThursdayInTime = Convert.ToDateTime(txtThuClockIn.Text); off.ThursdayOutTime = Convert.ToDateTime(txtThuClockOut.Text); off.FridayInTime = Convert.ToDateTime(txtFriClockIn.Text); off.FridayOutTime = Convert.ToDateTime(txtFriClockOut.Text); off.SaturdayInTime = Convert.ToDateTime(txtSatClockIn.Text); off.SaturdayOuttime = Convert.ToDateTime(txtSatClockOut.Text); off.SundayInTime = Convert.ToDateTime(txtSunClockIn.Text); off.SundayOutTime = Convert.ToDateTime(txtSunClockOut.Text); off.CompanyId = CPublic.GetCompanyID(); off.CreatedBy = CPublic.GetuserID(); off.ModifiedBy = CPublic.GetuserID(); Entities.OutputMessage result = null; if (off.ID == 0) { result = off.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = off.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void Page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlNationality.LoadCountry(CPublic.GetCompanyID()); ddlDept.LoadDepartments(CPublic.GetCompanyID()); ddlDesig.LoadDesignation(CPublic.GetCompanyID()); } }
protected void Page_LoadComplete(object sender, EventArgs e) { var Employees = Entities.Payroll.Employee.GetDetails(CPublic.GetCompanyID()).Where(x => x.Status != 0).ToList(); for (int i = 0; i < Employees.Count; i++) { ltrEmpList.Text += @"<tr><td><div class='checkbox mark-employee'> <input type='checkbox'/> <label for=''></label> </div></td><td data-empid='" + Employees[i].ID + "'>" + Employees[i].FirstName + " " + Employees[i].LastName + "</td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td><td class='text-center attendance-box'> <span class='attendance' data-attendance='0'>-</span> </td></tr>"; } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlReverseHead.LoadAccountHeads(CPublic.GetCompanyID()); ddlParentGroup.LoadAccountGroups(CPublic.GetCompanyID()); FillTree(); } }
protected void Page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlEmpolyee.LoadEmployee(CPublic.GetCompanyID()); ddlUserLocation.LoadLocations(CPublic.GetCompanyID()); ddlUser.LoadUsers(CPublic.GetCompanyID()); ddlGroup.LoadUserGroups(); } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlParentGroup.LoadAccountGroups(CPublic.GetCompanyID()); Entities.Finance.AccountGroup account = new Entities.Finance.AccountGroup(); moduleTree.Nodes.Clear(); account.BindTree(moduleTree, CPublic.GetCompanyID()); } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { ddlUOM.LoadUnits(CPublic.GetCompanyID()); ddlBrand.LoadBrands(CPublic.GetCompanyID()); ddlCategory.LoadCategories(CPublic.GetCompanyID()); ddlTax.LoadTaxes(CPublic.GetCompanyID()); ddlGroup.LoadGroups(CPublic.GetCompanyID()); ddlType.LoadTypes(CPublic.GetCompanyID()); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Location location = new Entities.Location(); location.ID = Convert.ToInt32(hdLocationId.Value); location.Name = txtName.Text.Trim(); location.Address1 = txtAddress1.Text.Trim(); location.Address2 = txtAddress2.Text.Trim(); location.Contact = txtContact.Text.Trim(); location.ContactPerson = txtContactPerson.Text.Trim(); location.RegId1 = txtRegId1.Text.Trim(); location.RegId2 = txtRegId2.Text.Trim(); location.Status = Convert.ToInt32(ddlStatus.SelectedValue); location.CompanyId = CPublic.GetCompanyID(); location.CreatedBy = CPublic.GetuserID(); location.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (location.ID == 0) { result = location.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = location.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { try { ddlVoucherType.LoadVoucherTypes(CPublic.GetCompanyID()); bindgrid(); } catch (Exception) { } } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Master.Despatch despatch = new Entities.Master.Despatch(); despatch.ID = Convert.ToInt32(hdDespatchId.Value); despatch.Name = txtName.Text.Trim(); despatch.Address = txtAddress.Text.Trim(); despatch.PhoneNo = txtPhone.Text.Trim(); despatch.MobileNo = txtMobile.Text.Trim(); despatch.ContactPerson = txtContactPerson.Text.Trim(); despatch.ContactPersonPhone = txtContactPersonPhone.Text.Trim(); despatch.Narration = txtNarration.Text.Trim(); despatch.Status = Convert.ToInt32(ddlStatus.SelectedValue); despatch.CompanyId = CPublic.GetCompanyID(); despatch.CreatedBy = CPublic.GetuserID(); despatch.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (despatch.ID == 0) { result = despatch.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = despatch.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (FormatException ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid despatch')", true); } }
protected void ddlVoucherType_SelectedIndexChanged(object sender, EventArgs e) { try { if (Session["type"].ToString() == "Expense") { Entities.Finance.ExpenseEntry.getAccountGroup(ddlfrommain, Convert.ToInt32(ddlVoucherType.SelectedValue)); ddltomain.LoadAccountHeadsVoucher(CPublic.GetCompanyID()); } } catch (Exception) { } }
private void FillTree() { try { Entities.Finance.AccountHeadMaster account = new Entities.Finance.AccountHeadMaster(); TreeNode tree = new TreeNode(); tree = account.GetTree(CPublic.GetCompanyID()); moduleTree.Nodes.Add(tree); moduleTree.CollapseAll(); } catch (Exception) { } }
protected void Page_LoadComplete(object sender, EventArgs e) { ddlCostCenter.LoadCost(CPublic.GetCompanyID()); ddlJob.LoadJobs(CPublic.GetCompanyID()); lblOrderNo.Text = Entities.Register.Register.GetOrderNo(Publics.CPublic.GetCompanyID(), Publics.CPublic.GetFinYear(), "PRQ"); if (Entities.Application.Settings.IsAutoRoundOff()) { txtRoundOff.Enabled = false; } else { txtRoundOff.Enabled = true; } }
private void bindgrid() { try { Entities.Finance.VoucherSettings Voucher = new Entities.Finance.VoucherSettings(); DataSet ds = new DataSet(); ds = Voucher.GetVoucherSetings(Convert.ToInt32(CPublic.GetCompanyID()), Convert.ToInt32(ddlVoucherType.SelectedValue), Convert.ToInt32(ddlgroupBy.SelectedValue)); gvAccounts.DataSource = ds; gvAccounts.DataBind(); } catch (Exception) { } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Finance.AccountGroup Account = new Entities.Finance.AccountGroup(); Account.Id = Convert.ToInt32(hdItemId.Value); Account.Name = txtAccountGroupName.Text; Account.Disable = Convert.ToInt32(ddlStatus.SelectedValue); Account.Description = txtDescription.Text; Account.Depth = 1; Account.ParentId = Convert.ToInt32(ddlParentGroup.SelectedValue); Account.Company = CPublic.GetCompanyID(); Account.AccountType = Convert.ToInt32(ddlAccountNature.SelectedValue); Account.CreatedBy = CPublic.GetuserID(); Account.IsAffectGP = Convert.ToInt32(ddlIsAffectGrossProfit.SelectedValue); Account.ModifiedBy = CPublic.GetuserID(); OutputMessage Result = null; if (Account.Id == 0) { Result = Account.Save(); if (Result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');window.setTimeout(function(){window.location.href = '/Finance/AccountGroup';}, 3000); ", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true); } } else { Result = Account.Update(); if (Result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + Result.Message + "');window.setTimeout(function(){window.location.href = '/Finance/AccountGroup';}, 3000);", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('" + Result.Message + "')", true); } } } catch (Exception) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid Group')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Category Cat = new Entities.Category(); Cat.ID = Convert.ToInt32(hdItemId.Value); Cat.Name = txtCategoryName.Text.Trim(); Cat.Order = Convert.ToInt32(txtCategoryOrder.Text); Cat.Status = Convert.ToInt32(ddlCategoryStatus.SelectedValue); Cat.CompanyId = CPublic.GetCompanyID(); Cat.CreatedBy = CPublic.GetuserID(); Cat.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (Cat.ID == 0) { result = Cat.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = Cat.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (FormatException) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('Enter a Valid Order')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Master.Vehicle vehicle = new Entities.Master.Vehicle(); vehicle.ID = Convert.ToInt32(hdVehicleId.Value); vehicle.Name = txtName.Text.Trim(); vehicle.Number = txtNumber.Text.Trim(); vehicle.Type = txtType.Text.Trim(); vehicle.Owner = txtOwner.Text.Trim(); vehicle.Status = Convert.ToInt32(ddlStatus.SelectedValue); vehicle.CompanyId = CPublic.GetCompanyID(); vehicle.CreatedBy = CPublic.GetuserID(); vehicle.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (vehicle.ID == 0) { result = vehicle.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = vehicle.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Payroll.SalaryComponent sal = new Entities.Payroll.SalaryComponent(); sal.ID = Convert.ToInt32(hdSalId.Value); sal.Name = txtName.Text.Trim(); sal.ComponentType = Convert.ToString(ddlCompType.SelectedValue); sal.CalculationType = Convert.ToString(ddlCalcType.SelectedValue); sal.Status = Convert.ToInt32(ddlStatus.SelectedValue); sal.CompanyId = CPublic.GetCompanyID(); sal.CreatedBy = CPublic.GetuserID(); sal.ModifiedBy = CPublic.GetuserID(); Entities.OutputMessage result = null; if (sal.ID == 0) { result = sal.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = sal.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { ProductType proType = new ProductType(); proType.ID = Convert.ToInt32(hdItemId.Value); proType.Name = txtTypeName.Text.Trim(); proType.Order = Convert.ToInt32(txtTypeOrder.Text.Trim()); proType.Status = Convert.ToInt32(ddlTypeStatus.SelectedValue); proType.companyId = CPublic.GetCompanyID(); proType.CreatedBy = CPublic.GetuserID(); proType.Modifiedby = CPublic.GetuserID(); OutputMessage result = null; if (proType.ID == 0) { result = proType.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = proType.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Tax tax = new Entities.Tax(); tax.ID = Convert.ToInt32(hdTaxId.Value); tax.Name = txtTaxName.Text.Trim(); tax.Percentage = Convert.ToDecimal(txtTaxPercentage.Text); tax.Type = txtTaxType.Text.Trim(); tax.Status = Convert.ToInt32(ddlTaxStatus.SelectedValue); tax.CompanyId = CPublic.GetCompanyID(); tax.CreatedBy = CPublic.GetuserID(); tax.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (tax.ID == 0) { result = tax.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = tax.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + " ')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Payroll.HourlyTemplate hour = new Entities.Payroll.HourlyTemplate(); hour.ID = Convert.ToInt32(hdHourId.Value); hour.Title = txtTitle.Text.Trim(); hour.Rate = Convert.ToDecimal(txtRate.Text.Trim()); hour.Status = Convert.ToInt32(ddlStatus.SelectedValue); hour.CompanyId = CPublic.GetCompanyID(); hour.CreatedBy = CPublic.GetuserID(); hour.ModifiedBy = CPublic.GetuserID(); Entities.OutputMessage result = null; if (hour.ID == 0) { result = hour.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = hour.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void btnSaveConfirmed_Click(object sender, EventArgs e) { try { Entities.Payroll.Designation desig = new Entities.Payroll.Designation(); desig.ID = Convert.ToInt32(hdDesigId.Value); desig.Name = txtDesignation.Text.Trim(); desig.Status = Convert.ToInt32(ddlStatus.SelectedValue); desig.DepartmentId = Convert.ToInt32(ddlDept.SelectedValue); desig.CompanyId = CPublic.GetCompanyID(); desig.CreatedBy = CPublic.GetuserID(); desig.ModifiedBy = CPublic.GetuserID(); OutputMessage result = null; if (desig.ID == 0) { result = desig.Save(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } else { result = desig.Update(); if (result.Success) { Reset(); ClientScript.RegisterStartupScript(this.GetType(), "message", "successAlert('" + result.Message + "');", true); } else { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + result.Message + "')", true); } } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "$('#add-item-portlet').addClass('in');errorAlert('" + ex.Message + "')", true); } }
protected void page_LoadComplete(object sender, EventArgs e) { if (!IsPostBack) { try { //Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions(); //fin.LoadAccountHeadsTypes(ddlAccountTypes); ddlAccountTypes.LoadAccountHeads(CPublic.GetCompanyID()); //ddlVoucherTypes.LoadVoucherTypesFinancial(CPublic.GetCompanyID()); ddlVoucherTypes.LoadVoucherTypes(CPublic.GetCompanyID()); txtFromDate.Text = string.Format("{0:dd-MMM-yyyy}", DateTime.UtcNow.AddHours(5.5)); txtTo.Text = string.Format("{0:dd-MMM-yyyy}", DateTime.UtcNow.AddHours(5.5).AddYears(1)); } catch (Exception) { } } }
protected void btnBalanceSheet_Click(object sender, EventArgs e) { try { Entities.Finance.FinancialTransactions fin = new Entities.Finance.FinancialTransactions(); int reportID = 1; hiddenCompanyId.Value = CPublic.GetCompanyID().ToString(); if (Convert.ToDateTime(txtFromDate.Text) > Convert.ToDateTime(txtToDate.Text)) { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('Enter Valid Date');", true); } else { grdLiteral.Text = fin.getbalanceSheet(hiddenCompanyId, hiddenReportId, txtFromDate, txtToDate, ddlCostCenter, reportID); } } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "message", "errorAlert('Something Went Wrong. " + ex.Message + "');", true); } }