private void GetReceiveDisposeHeadMasterId(int ID) { pd = new ProcurementData(); DataSet DS = new DataSet(); DS = pd.GetReceiveDisposeHeadMasterId(ID); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpStatus.ClearSelection(); if (dpStatus.Items.FindByText(DS.Tables[0].Rows[0]["Purpose"].ToString()) != null) { dpStatus.Items.FindByText(DS.Tables[0].Rows[0]["Purpose"].ToString()).Selected = true; } txtParticular.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Particular"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Particular"].ToString(); dpIsActive.ClearSelection(); if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "True") { dpIsActive.Items.FindByValue("1").Selected = true; } if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "False") { dpIsActive.Items.FindByValue("2").Selected = true; } } }
protected void btnView_Click(object sender, EventArgs e) { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); Model.Procurement p = new Model.Procurement(); p.CenterID = 6;//Convert.ToInt32(dpCenter.SelectedItem.Value); if (rdDisposal.Checked) { p.Date = Convert.ToDateTime(txtDate.Text); flag = "dispose"; } if (rdRecieving.Checked) { flag = "receive"; p.Date = Convert.ToDateTime(txtDate.Text); } p.flag = flag; DS = pd.GetAllBatchWiseMilkCollectionDetails(p); try { rpBatchWiseMilkCollection.DataSource = DS; rpBatchWiseMilkCollection.DataBind(); } catch { } uprouteList.Update(); }
protected void btnView_Click(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.Date = Convert.ToDateTime(txtDate1.Text); p.RouteID = Convert.ToInt32(dpRoute1.SelectedItem.Value); if (dpSession1.SelectedItem.Value == "0") { p.Session = "0"; } else { p.Session = dpSession1.SelectedItem.Text.ToString(); } DataSet DS1 = new DataSet(); DS1 = pd.ViewMilkCollectionDetails(p); if (!Comman.Comman.IsDataSetEmpty(DS1)) { rpMilkCollectionList.DataSource = DS1; rpMilkCollectionList.DataBind(); uprouteList.Update(); } }
private void DeleteReceiveandDisposeMaster(int typeID) { pd = new ProcurementData(); p = new Model.Procurement(); int Result = 0; p.ID = string.IsNullOrEmpty(hfBrandId.Value) ? 0 : Convert.ToInt32(hfBrandId.Value); p.particular = txtParticular.Text; p.purpose = dpStatus.SelectedItem.Text; p.flag = "Delete"; Result = pd.InsertReceiveandDisposeMaster(p); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Receive and Dispose Master Deleted Successfully"; GetReceiveDisposeHeadMaster(); upMain.Update(); pnlError.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void BindSupplierList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllSupplierProfiles(); if (!Comman.Comman.IsDataSetEmpty(DS)) { if (!string.IsNullOrEmpty(DS.Tables[1].Rows[0]["id"].ToString())) { int count = Convert.ToInt32(DS.Tables[1].Rows[0]["id"]); count = count + 1; //txtSupplierCode.Text = string.Format("S{0:0000}", count); txtSupplierCode.Text = Convert.ToString(count); txtSupplierCode.ReadOnly = false; rpSupplierProfList.DataSource = DS; rpSupplierProfList.DataBind(); } else { int count = 1; //txtSupplierCode.Text = string.Format("S{0:0000}", count); txtSupplierCode.Text = Convert.ToString(count); txtSupplierCode.ReadOnly = false; } } }
protected void btnAddVehicle_Click(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.VehicleMasterID = 0; //p.VehicleName = txtVehicleName.Text; p.VehicleNo = txtVehicleNo.Text; p.VehicleID1 = 'V' + txtVehicleNo.Text; p.VehicleOwnerName = txtOwnerName.Text; p.OwnerEmail = txtOwnerEmail.Text; p.OwnerMobileNo = txtOwnerMobileNo.Text; p.TransportType = dpTransportType.SelectedItem.Text; p.VehicleType = Convert.ToInt32(dpVehicleType.SelectedItem.Value); p.DriverName = txtDriverName.Text; p.DriverMobileNo = txtDriverMobile.Text; p.OwnerBankName = dpBankName.SelectedItem.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.BranchName = txtBranchName.Text; p.AccountNo = txtAccNo.Text; p.RouteID = Convert.ToInt32(dpRoute.SelectedItem.Value); p.tdspercentage = Convert.ToDouble(txtTDSPercent.Text); p.CreatedBy = App_code.GlobalInfo.Userid; if (DropDownList1.SelectedValue == "1") { p.IsActive = true; } else if (DropDownList1.SelectedValue == "2") { p.IsActive = false; } p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Insert"; int Result = 0; Result = pd.InsertVehicleDetails(p); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Vehicle Record Add Successfully"; ClearTextBox(); BindVehicleList(); pnlError.Update(); upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void GetBatchWiseMilkCollectionDetailsbyID(int milkcollectionid) { DataSet DS = new DataSet(); ProcurementData pd = new ProcurementData(); DS = pd.GetBatchWiseMilkCollectionDetailsbyID(milkcollectionid); if (!Comman.Comman.IsDataSetEmpty(DS)) { txtFATPercentage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FATPercentage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FATPercentage"].ToString(); txtMilkInKG.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MilkInKG"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MilkInKG"].ToString(); txtMilkInLtr.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MilkInLtr"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MilkInLtr"].ToString(); txtVehicalNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicalNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicalNo"].ToString(); txtTEmp.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Temp"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Temp"].ToString(); txtSNFPercentage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SNFPercentage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SNFPercentage"].ToString(); txtAcidity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Acidity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Acidity"].ToString(); dpRoute.ClearSelection(); if (dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()) != null) { dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()).Selected = true; } dpCenter.ClearSelection(); if (dpCenter.Items.FindByValue(DS.Tables[0].Rows[0]["CenterID"].ToString()) != null) { dpCenter.Items.FindByValue(DS.Tables[0].Rows[0]["CenterID"].ToString()).Selected = true; } txtBatch.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString(); txtDate.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Date"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Date"].ToString(); dpSession.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Session"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Session"].ToString(); } }
private void UpdateRecord(int SupplierID, int RouteID, string PaymentDateTime, DateTime FomDate, DateTime ToDate, double Amount, double Bonus, decimal Scheme, double RDAmount, double canloan, double casloan, double bankloan, double netamt) { int result = 0; ProcurementData pd = new ProcurementData(); result = pd.AddTransaction(SupplierID, RouteID, PaymentDateTime, FomDate, ToDate, Amount, Bonus, Scheme, RDAmount, canloan, casloan, bankloan, netamt); if (result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Transaction Updated Successfully"; pnlError.Update(); upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void GetVehicleDetailsbyID(int vehicleid) { DataSet DS = new DataSet(); ProcurementData pd = new ProcurementData(); DS = pd.GetVehicleDetailsbyID(vehicleid); if (!Comman.Comman.IsDataSetEmpty(DS)) { //txtVehicleSrNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicleSrNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicleSrNo"].ToString(); txtVehicleNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicleNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicleNo"].ToString(); //txtVehicleName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicleName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicleName"].ToString(); txtOwnerName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicleOwnerName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicleOwnerName"].ToString(); txtOwnerMobileNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OwnerMobileNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["OwnerMobileNo"].ToString(); txtOwnerEmail.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["OwnerEmail"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["OwnerEmail"].ToString(); txtDriverName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DriverName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DriverName"].ToString(); txtDriverMobile.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["DriverMobileNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["DriverMobileNo"].ToString(); txtBranchName.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BranchName"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BranchName"].ToString(); dpIfscCode.ClearSelection(); if (dpIfscCode.Items.FindByText(DS.Tables[0].Rows[0]["IFSCCode"].ToString()) != null) { dpIfscCode.Items.FindByText(DS.Tables[0].Rows[0]["IFSCCode"].ToString()).Selected = true; } txtAccNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["AccountNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["AccountNo"].ToString(); dpRoute.ClearSelection(); if (dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()) != null) { dpRoute.Items.FindByValue(DS.Tables[0].Rows[0]["RouteID"].ToString()).Selected = true; } // txtTax.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Tax"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Tax"].ToString(); txtTDSPercent.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TDS"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["TDS"].ToString(); dpVehicleType.ClearSelection(); if (dpVehicleType.Items.FindByValue(DS.Tables[0].Rows[0]["VehicleType"].ToString()) != null) { dpVehicleType.Items.FindByValue(DS.Tables[0].Rows[0]["VehicleType"].ToString()).Selected = true; } dpTransportType.ClearSelection(); if (dpTransportType.Items.FindByText(DS.Tables[0].Rows[0]["TransportType"].ToString()) != null) { dpTransportType.Items.FindByText(DS.Tables[0].Rows[0]["TransportType"].ToString()).Selected = true; } dpBankName.ClearSelection(); if (dpBankName.Items.FindByText(DS.Tables[0].Rows[0]["OwnerBankName"].ToString()) != null) { dpBankName.Items.FindByText(DS.Tables[0].Rows[0]["OwnerBankName"].ToString()).Selected = true; } DropDownList1.ClearSelection(); if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "True") { DropDownList1.Items.FindByValue("1").Selected = true; } else if (DS.Tables[0].Rows[0]["IsActive"].ToString() == "False") { DropDownList1.Items.FindByValue("2").Selected = true; } } }
protected void btnupdateMilkCollection_Click(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.MilkCollectionTransportID = string.IsNullOrEmpty(hfMilkCollectionID.Value) ? 0 : Convert.ToInt32(hfMilkCollectionID.Value);; p.Date = Convert.ToDateTime(txtDate.Text); p.VehicleNo = dpVehicleNo.SelectedItem.Text; p.RouteID = Convert.ToInt32(dpRoute.SelectedItem.Value); p.MorningKM = Convert.ToDouble(txtMorningKM.Text); p.EveningKM = Convert.ToDouble(txtEveningKM.Text); p.Bata = Convert.ToDouble(txtBata.Text); p.InstallmentAmount = Convert.ToDouble(txtAmount.Text); p.MorningInTime = txtMorningInTime.Text; p.MorningOutTime = txtMorningOutTime.Text; p.EveningInTime = txtEveningInTime.Text; p.EveningOutTime = txtEveningOutTime.Text; p.MorningInCan = txtMCanIn.Text; p.MorningOutCan = txtMCanOut.Text; p.EveningInCan = txtEInCan.Text; p.EveningOutCan = txtEOutCan.Text; p.DriverName = txtDriverName.Text; p.Remarks = txtRemarks.Text; p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Update"; int Result = 0; Result = pd.InsertMilkCollectionTransportDetails(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Milk Collection Record Updated Successfully"; ClearTextBox(); string dates = Convert.ToDateTime(txtDate1.Text).ToString("dd-MM-yyyy"); string vehicle = dpVehicleNo1.SelectedItem.Text; int route = Convert.ToInt32(dpRoute1.SelectedItem.Value); //BindMilkCollectionList(dates, vehicle, route); pnlError.Update(); btnAddMilkTransport.Visible = true; btnupdateMilkTransport.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
protected void btnupdateMilkCollection_Click(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.MilkCollectionID = string.IsNullOrEmpty(hfMilkCollectionID.Value) ? 0 : Convert.ToInt32(hfMilkCollectionID.Value); p.Batch = txtBatch.Text; p.Session = dpSession.SelectedItem.Text; p.Date = Convert.ToDateTime(txtDate.Text); p.MilkInKG = Convert.ToDecimal(txtMilkInKG.Text); p.MilkInLtr = Convert.ToDecimal(txtMilkInLtr.Text); p.ActualMilkInLtr = Convert.ToDecimal(txtMilkInLtr.Text); p.RouteID = Convert.ToInt32(dpRoute.SelectedItem.Value); p.SupplierID = Convert.ToInt32(dpSupplier.SelectedItem.Value); p.FATPercentage = Convert.ToDecimal(txtFATPercentage.Text); p.FATInKG = Convert.ToDecimal(txtFATInKG.Text); p.CLRReading = Convert.ToDecimal(txtCLRReading.Text); //p.SNF = Convert.ToDecimal(txtSNF.Text); p.SNFPercentage = Convert.ToDecimal(txtSNFPercentage.Text); p.SNFInKG = Convert.ToDecimal(txtSNFInKG.Text); p.TSPercentage = Convert.ToDecimal(txtTSPercentage.Text); p.TSInKg = Convert.ToDecimal(txtTSKG.Text); p.MilkCan = Convert.ToInt32(txtMilkCan.Text); p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Update"; int Result = 0; Result = pd.InsertMilkCollectionDetails(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Milk Collection Record Updated Successfully"; ClearTextBox(); //BindMilkCollectionList(); pnlError.Update(); btnAddMilkCollection.Visible = true; btnupdateMilkCollection.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
protected void GetExistingData() { int routeid = Convert.ToInt32(dpRoute.SelectedItem.Value); foreach (RepeaterItem item in rpRouteList.Items) { HiddenField hdfID = item.FindControl("hfSupplierID") as HiddenField; int supplyierid = Convert.ToInt32(hdfID.Value); string date1 = txtpaymentdate.Text; string date2 = txtfromdate.Text; string date3 = txttodate.Text; ProcurementData pd = new ProcurementData(); DS = pd.GetExistingData(supplyierid, routeid, date1, date2, date3); if (!Comman.Comman.IsDataSetEmpty(DS)) { System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(System.Web.UI.Page), "Script", "Confirm();", true); } else { foreach (RepeaterItem item1 in rpRouteList.Items) { TextBox txtAmt = item1.FindControl("txtAmt") as TextBox; TextBox txtBonus = item1.FindControl("txtBonus") as TextBox; TextBox txtScheme = item1.FindControl("txtScheme") as TextBox; TextBox txtRD = item1.FindControl("txtRD") as TextBox; TextBox txtcanloan = item1.FindControl("txtcanloan") as TextBox; TextBox txtcashloan = item1.FindControl("txtcashloan") as TextBox; TextBox txtbankloan = item1.FindControl("txtbankloan") as TextBox; TextBox txtNetAmt = item1.FindControl("txtNetAmt") as TextBox; HiddenField hdfID1 = item.FindControl("hfSupplierID") as HiddenField; if (hdfID1 != null) { int SupplierID = Convert.ToInt32(hdfID1.Value); int RouteID = Convert.ToInt32(dpRoute.SelectedItem.Value); string PaymentDateTime = txtpaymentdate.Text; DateTime FomDate = Convert.ToDateTime(txtfromdate.Text); DateTime ToDate = Convert.ToDateTime(txttodate.Text); double Amount = string.IsNullOrEmpty(txtAmt.Text) ? 0 : Convert.ToDouble(txtAmt.Text); double Bonus = string.IsNullOrEmpty(txtBonus.Text) ? 0 : Convert.ToDouble(txtBonus.Text); decimal Scheme = string.IsNullOrEmpty(txtScheme.Text) ? 0 : Convert.ToDecimal(txtScheme.Text); double RDAmount = string.IsNullOrEmpty(txtRD.Text) ? 0 : Convert.ToDouble(txtRD.Text); double canloan = string.IsNullOrEmpty(txtcanloan.Text) ? 0 : Convert.ToDouble(txtcanloan.Text); double casloan = string.IsNullOrEmpty(txtcashloan.Text) ? 0 : Convert.ToDouble(txtcashloan.Text); double bankloan = string.IsNullOrEmpty(txtbankloan.Text) ? 0 : Convert.ToDouble(txtbankloan.Text); double netamt = string.IsNullOrEmpty(txtNetAmt.Text) ? 0 : Convert.ToDouble(txtNetAmt.Text); UpdateRecord(SupplierID, RouteID, PaymentDateTime, FomDate, ToDate, Amount, Bonus, Scheme, RDAmount, canloan, casloan, bankloan, netamt); } } } } }
public void DeleteRoutebyrouteID(int CenterID) { // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Do you want to delete')", true); Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.LoanID = string.IsNullOrEmpty(hfLoanID.Value) ? 0 : Convert.ToInt32(hfLoanID.Value); p.SupplierID = Convert.ToInt32(dpSupplier.SelectedValue); p.LoanType = ddLoanType.SelectedItem.Text; p.AccounNumber = txtLoanAccountNo.Text; p.LoanAmount = 0; p.LoanTakenDate = txtLoanTakenDate.Text; p.LoanDuration = txtLoanDuration.Text; p.LoanPaid = 0; p.LoanBalance = 0; p.LoanStatus = DropDownList1.SelectedItem.Text; p.BankName = dpBankName.SelectedItem.Text; //p.BranchName = txtBranchName.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.Interest = 0; p.LoanBalance = 0; p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Delete"; int Result = 0; Result = pd.InsertSupplierLoanInfo(p); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Delete Updated Successfully"; ClearTextBox(); BindeSupplierLoanInfo(); pnlError.Update(); btnLoanadd.Visible = true; btnLoanUpdate.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void DeleteVehiclebyvehicleID(int vehicleid) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.VehicleMasterID = string.IsNullOrEmpty(hfrouteID.Value) ? 0 : Convert.ToInt32(hfrouteID.Value); p.VehicleName = string.Empty; p.VehicleNo = string.Empty; p.VehicleID1 = string.Empty; p.VehicleOwnerName = string.Empty; p.OwnerEmail = string.Empty; p.OwnerMobileNo = string.Empty; //p.VehicleSrNo = string.Empty; p.tdspercentage = 0; p.VehicleType = 0; p.DriverName = string.Empty; p.DriverMobileNo = string.Empty; p.OwnerBankName = dpBankName.SelectedItem.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.BranchName = string.Empty; p.AccountNo = string.Empty; p.RouteID = 0; p.IsActive = false; p.TransportType = dpTransportType.SelectedItem.Text; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Delete"; int Result = 0; Result = pd.InsertVehicleDetails(p); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Delete Updated Successfully"; ClearTextBox(); BindVehicleList(); pnlError.Update(); btnAddVehicle.Visible = true; btnupdateVehicle.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
protected void btnClick_btnLoanUpdate(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.LoanID = string.IsNullOrEmpty(hfLoanID.Value) ? 0 : Convert.ToInt32(hfLoanID.Value); p.SupplierID = Convert.ToInt32(dpSupplier.SelectedValue); p.LoanType = ddLoanType.SelectedItem.Text; p.AccounNumber = txtLoanAccountNo.Text; p.LoanAmount = Convert.ToDouble(txtLoanAmt.Text); p.LoanTakenDate = txtLoanTakenDate.Text; p.LoanDuration = txtLoanDuration.Text; p.LoanPaid = Convert.ToDouble(txtLoadPaid.Text); p.LoanBalance = Convert.ToDouble(txtLoanBalance.Text); p.LoanStatus = DropDownList1.SelectedItem.Text; p.BankName = dpBankName.SelectedItem.Text; //p.BranchName = txtBranchName.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.Interest = Convert.ToDouble(txtInterest.Text); p.LoanBalance = Convert.ToDouble(txtLoanBalance.Text); p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Update"; int Result = 0; Result = pd.InsertSupplierLoanInfo(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Supplier Loan Info Updated Successfully"; ClearTextBox(); BindeSupplierLoanInfo(); pnlError.Update(); btnLoanadd.Visible = true; btnLoanUpdate.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
private void BindIncentiveList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); DS = pd.GetIncentivetariff(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpIncentiveTariff.DataSource = DS; rpIncentiveTariff.DataBind(); } }
public void DeleteRDInfoByRDID(int RDID) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.RDID = string.IsNullOrEmpty(hfRDID.Value) ? 0 : Convert.ToInt32(hfRDID.Value); p.RouteID = 0; p.SupplierID = 0; p.RDStartDate = txtRDStartDate.Text; p.RDMaturityDate = txtRDMaturityDate.Text; p.RDAmount = 0; p.RepaymentAmt = 0; p.RDStatus = DropDownList1.SelectedItem.Text; p.RDPaymentDateTime = txtRDPaymentDate.Text; p.AccounNumber = txtAccountNo.Text; p.BankName = dpBankName.SelectedItem.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.BranchName = txtBranchName.Text; p.AccountName = txtAccountName.Text; p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Delete"; int Result = 0; Result = pd.InsertSupplierRDInfo(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Supplier RD Info Deleted Successfully"; ClearTextBox(); BindeSupplierRDInfo(); pnlError.Update(); btnAddRDInfo.Visible = true; btnupdateRDInfo.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
public void BindBankInfoList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllSupplierBankDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpBankInfoList.DataSource = DS; rpBankInfoList.DataBind(); } }
public void BindeSupplierSchemeInfo() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllSupplierSchemeInfo(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpSchemeInfo.DataSource = DS; rpSchemeInfo.DataBind(); } }
public void BindVehicleList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllVehicleMasterDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpVehicleMaster.DataSource = DS; rpVehicleMaster.DataBind(); } }
public void GetVehicleType() { pd = new ProcurementData(); DataSet DS = new DataSet(); DS = pd.GetVehicleType(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpVehicleType.DataSource = DS; rpVehicleType.DataBind(); } }
private void GetReceiveDisposeHeadMaster() { pd = new ProcurementData(); DataSet DS = new DataSet(); DS = pd.GetReceiveDisposeHeadMaster(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpVehicleType.DataSource = DS; rpVehicleType.DataBind(); } }
public void BindMilkCollectionList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllMilkCollectionDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpMilkCollectionList.DataSource = DS; rpMilkCollectionList.DataBind(); } }
public void BindRawMilkTerrifList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllRawMilkTarrifDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpRawMilkTarrif.DataSource = DS; rpRawMilkTarrif.DataBind(); } }
protected void txtEveningKM_TextChanged(object sender, EventArgs e) { try { int MorningKM; int EveningKM; double totalkm; MorningKM = string.IsNullOrEmpty(txtMorningKM.Text) ? 0 : Convert.ToInt32(txtMorningKM.Text); EveningKM = string.IsNullOrEmpty(txtEveningKM.Text) ? 0 : Convert.ToInt32(txtEveningKM.Text); totalkm = Convert.ToDouble(MorningKM + EveningKM); txtTotalKM.Text = totalkm.ToString(); txtEveningInTime.Focus(); DS = BindCommanData.BindCommanDropDwon("VehicleMasterID ", "VehicleType", "Proc_VehicleMaster", "IsActive=1 and VehicleMasterID=" + dpVehicleNo.SelectedItem.Value); if (!Comman.Comman.IsDataSetEmpty(DS)) { int modelid = 0; //double tds; double tariff = 0.00;; double amt = 0.00; var vehiclemodelid = DS.Tables[0].AsEnumerable().Select(r => r.Field <int>("VehicleType")).ToList(); modelid = Convert.ToInt32(vehiclemodelid[0]); DataSet ds = new DataSet(); ProcurementData pd = new ProcurementData(); ds = pd.GetBataandAmountOfVehicleonbasisofmodelid(modelid, Convert.ToInt32(dpVehicleNo.SelectedItem.Value)); if (!Comman.Comman.IsDataSetEmpty(DS)) { foreach (DataRow row in ds.Tables[0].Rows) { if (Convert.ToDouble(row["KMLow"]) <= totalkm && Convert.ToDouble(row["KMHigh"]) >= totalkm) { txtBata.Text = Convert.ToDecimal(row["Bata"]).ToString("#.##"); tariff = Convert.ToDouble(row["Amount"]); amt = totalkm * tariff; txtAmount.Text = amt.ToString(); } } //tds = Convert.ToDouble(ds.Tables[1].Rows[0]["TDS"]); //amt = totalkm + (Convert.ToDouble(totalkm) * tds / 100); //txtAmount.Text = amt.ToString(); //tariff = Convert.ToDouble(ds.Tables[0].Rows[0]["Amount"]); //amt = totalkm * tariff; //txtAmount.Text = amt.ToString(); } } } catch (Exception) { } }
public void DeleteRoutebyrouteID(int rawid) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.RawMilkTarrifID = string.IsNullOrEmpty(hfrouteID.Value) ? 0 : Convert.ToInt32(hfrouteID.Value); //p.Category = Convert.ToInt32(Category.SelectedItem.Value); p.Category = string.IsNullOrEmpty(txtCategory.Text) ? string.Empty : txtCategory.Text; p.TSL = string.IsNullOrEmpty(txtTSL.Text) ? 0 : Convert.ToDecimal(txtTSL.Text); p.TSH = string.IsNullOrEmpty(txtTSH.Text) ? 0 : Convert.ToDecimal(txtTSH.Text); p.TSRATE = string.IsNullOrEmpty(txtTSRate.Text) ? 0 : Convert.ToDecimal(txtTSRate.Text); p.TS_INCR = 0; p.Incentive = string.IsNullOrEmpty(txtIncentive.Text) ? 0 : Convert.ToInt32(txtIncentive.Text); p.IN_FAT = string.IsNullOrEmpty(txtIN_FAT.Text) ? 0 : Convert.ToInt32(txtIN_FAT.Text); p.IN_SNF = string.IsNullOrEmpty(txtIN_SNF.Text) ? 0 : Convert.ToInt32(txtIN_SNF.Text); p.IN_TS = string.IsNullOrEmpty(txtIN_TS.Text) ? 0 : Convert.ToInt32(txtIN_TS.Text); p.Bonus1 = string.IsNullOrEmpty(txtBonus.Text) ? 0 : Convert.ToDecimal(txtBonus.Text); p.Scheme = string.IsNullOrEmpty(txtScheme.Text) ? 0 : Convert.ToDecimal(txtScheme.Text); p.WEF_DATE = Convert.ToDateTime(txtWEF_DATE.Text); p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Delete"; int Result = 0; Result = pd.InsertRawMilkTarrif(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Raw Milk Tarrif Record Deleted Succefully Successfully"; ClearTextBox(); BindRawMilkTerrifList(); pnlError.Update(); btnAddRaw.Visible = true; btnupdateRaw.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }
protected void rdDisposal_CheckedChanged(object sender, EventArgs e) { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllBatchWiseMilkCollectionDetail(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpBatchWiseMilkCollection.DataSource = DS.Tables[1]; rpBatchWiseMilkCollection.DataBind(); } uprouteList.Update(); }
public void BindMilkCollectionList() { ProcurementData pd = new ProcurementData(); DataSet DS = new DataSet(); StringBuilder sb = new StringBuilder(); DS = pd.GetAllBatchWiseMilkCollectionDetail(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpBatchWiseMilkCollection.DataSource = DS.Tables[0]; rpBatchWiseMilkCollection.DataBind(); } uprouteList.Update(); }
public void GetBatchWiseMilkCollectionDetailsbyID(int milkcollectionid) { DataSet DS = new DataSet(); ProcurementData pd = new ProcurementData(); if (rdRecieving.Checked) { flag = "receive"; } else { flag = "dispose"; } DS = pd.GetBatchWiseMilkCollection(milkcollectionid, flag); if (!Comman.Comman.IsDataSetEmpty(DS)) { txtFATPercentage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FATPercentage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FATPercentage"].ToString(); txtMilkInKG.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MilkInKG"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MilkInKG"].ToString(); txtMilkInLtr.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["MilkInLtr"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["MilkInLtr"].ToString(); txtVehicalNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VehicalNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VehicalNo"].ToString(); txtTEmp.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Temp"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Temp"].ToString(); txtSNFPercentage.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SNFPercentage"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SNFPercentage"].ToString(); txtAcidity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Acidity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Acidity"].ToString(); dpMilkType.ClearSelection(); if (dpMilkType.Items.FindByText(DS.Tables[0].Rows[0]["MilkType"].ToString()) != null) { dpMilkType.Items.FindByText(DS.Tables[0].Rows[0]["MilkType"].ToString()).Selected = true; } dpParticularreceive.ClearSelection(); if (rdRecieving.Checked) { if (dpParticularreceive.Items.FindByValue(DS.Tables[0].Rows[0]["Particular"].ToString()) != null) { dpParticularreceive.Items.FindByValue(DS.Tables[0].Rows[0]["Particular"].ToString()).Selected = true; } } dpParticulardispose.ClearSelection(); if (rdDisposal.Checked) { if (dpParticulardispose.Items.FindByValue(DS.Tables[0].Rows[0]["Particular"].ToString()) != null) { dpParticulardispose.Items.FindByValue(DS.Tables[0].Rows[0]["Particular"].ToString()).Selected = true; } } txtBatch.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString(); txtDate.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Date"].ToString()) ? string.Empty : Convert.ToDateTime(DS.Tables[0].Rows[0]["Date"]).ToString("yyyy-MM-dd"); txtTime.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Session"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Session"].ToString(); } }
protected void btnClick_btnTariffUpdate(object sender, EventArgs e) { Model.Procurement p = new Model.Procurement(); ProcurementData pd = new ProcurementData(); p.BankDetailsID = string.IsNullOrEmpty(hfBankID.Value) ? 0 : Convert.ToInt32(hfBankID.Value); p.SupplierID = Convert.ToInt32(dpSupplier.SelectedValue); p.AccounNumber = txtAccountNo.Text; p.AccountType = DropDownList1.SelectedItem.Text; p.BankName = dpBankName.SelectedItem.Text; p.IFSCCode = dpIfscCode.SelectedItem.Text; p.BankAddress = txtAddress.Text; p.BranchName = txtBranchName.Text; p.AccountType = DropDownList1.SelectedItem.Text; p.CreatedBy = App_code.GlobalInfo.Userid; p.Createddate = DateTime.Now.ToString("dd-MM-yyyy"); p.ModifiedBy = App_code.GlobalInfo.Userid; p.ModifiedDate = DateTime.Now.ToString("dd-MM-yyyy"); p.flag = "Update"; int Result = 0; Result = pd.InsertSupplierBankDetails(p); if (Result > 0) { //lbltital.Text = "Add Route"; divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "SupplierBank Details Updated Successfully"; ClearTextBox(); BindBankInfoList(); pnlError.Update(); btnTariffAdd.Visible = true; btnTariffUpdate.Visible = false; upMain.Update(); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblwarning.Text = "Please Contact to Site Admin"; pnlError.Update(); } }