protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("AgentID", "AgentCode+' '+AgentName as Name", "AgentMaster", "IsArchive=0 and Agensytype='Booth'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgent.DataSource = DS; dpAgent.DataBind(); dpAgent.Items.Insert(0, new ListItem("--Select Booth --", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("CategoryId", "CategoryName as Name", "Category", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBrand.DataSource = DS; dpBrand.DataBind(); dpBrand.Items.Insert(0, new ListItem("--All Brand--", "0")); } txtDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeData empData = new EmployeeData(); DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpRoute.DataSource = DS; dpRoute.DataBind(); dpRoute.Items.Insert(0, new ListItem("--All Route --", "0")); } DS = BindCommanData.BindCommanDropDwon("CategoryId", "CategoryName as Name", "Category", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBrand.DataSource = DS; dpBrand.DataBind(); dpBrand.Items.Insert(0, new ListItem("--All Brand--", "0")); } txtStartDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); txtEndDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); } }
protected void Page_Load(object sender, EventArgs e) { lblmsg.Visible = false; DataSet DS = new DataSet(); if (!IsPostBack) { DS = BindCommanData.BindCommanDropDwon("AgentID", "AgentCode+' '+AgentName as Name", "AgentMaster", "IsArchive=0 and Agensytype='Booth'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgent.DataSource = DS; dpAgent.DataBind(); dpAgent.Items.Insert(0, new ListItem("--Select Booth--", "0")); dpBooth.DataSource = DS; dpBooth.DataBind(); dpBooth.Items.Insert(0, new ListItem("--Select Booth--", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("ShiftId as Id", "ShiftName as Name", "ShiftMaster", "IsActive = 1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpShift.DataSource = DS; dpShift.DataBind(); dpShift.Items.Insert(0, new ListItem("--Select Shift--", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("CenterID", "CenterCode+' '+CenterName as Name", "tbl_MilkCollectionCenter", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpCollectionCenter.DataSource = DS; dpCollectionCenter.DataBind(); dpCollectionCenter.Items.Insert(0, new ListItem("--Select Collection Center--", "0")); } } }
public void BindDropDwon() { DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("EmployeeID ", "EmployeeCode +' '+EmployeeName as Name ", "EmployeeMaster", "IsActive=1 and Designation='Sales' "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpSalesman.DataSource = DS; dpSalesman.DataBind(); dpSalesman.Items.Insert(0, new ListItem("--Select First Salesman--", "0")); dpSalesman2.DataSource = DS; dpSalesman2.DataBind(); dpSalesman2.Items.Insert(0, new ListItem("--Select Second Salesman--", "0")); } DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("DriverId", "Dr_Name as Name ", "tblDriverDetails", "IsActive='True' "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpDriver.DataSource = DS; dpDriver.DataBind(); dpDriver.Items.Insert(0, new ListItem("--Select First Driver--", "0")); dpDriver2.DataSource = DS; dpDriver2.DataBind(); dpDriver2.Items.Insert(0, new ListItem("--Select Second Driver--", "0")); } DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("TM_Id ", "VehicleNo as Name ", "tblTransportMaster", "TM_Id is not null"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVehicle.DataSource = DS; dpVehicle.DataBind(); dpVehicle.Items.Insert(0, new ListItem("--Select Vehicle No--", "0")); } }
public void BindDropDwon() { DS = new DataSet(); //DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=1 "); //if (!Comman.Comman.IsDataSetEmpty(DS)) //{ // dpagentRoute.DataSource = DS; // dpagentRoute.DataBind(); // dpagentRoute.Items.Insert(0, new ListItem("--Select Agent Route --", "0")); //} DS.Clear(); DS = BindCommanData.BindCommanDropDwon("AgentID", "AgentCode+' '+AgentName as Name", "AgentMaster", "IsArchive=0 and Isactive=1 and Agensytype='Agency' Order by AgentCode"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgent.DataSource = DS; dpAgent.DataBind(); dpAgent.Items.Insert(0, new ListItem("--Select Agent --", "0")); } DS.Clear(); //DS = BindCommanData.BindCommanDropDwon("TypeID", "TypeName", "TypeMaster", "IsArchive=1"); //if (!Comman.Comman.IsDataSetEmpty(DS)) //{ // dpAgentProductType.DataSource = DS; // dpAgentProductType.DataBind(); // dpAgentProductType.Items.Insert(0, new ListItem("--Select Product Type --", "0")); //} }
public void BindDropDwon() { DS = BindCommanData.BindCommanDropDwon("ID ", "particular as Name ", "Proc_ReceiveandDisposalMaster", "Purpose='Receive' "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpParticularreceive.DataSource = DS; dpParticularreceive.DataBind(); dpParticularreceive.Items.Insert(0, new ListItem("--Select Particular --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "particular as Name ", "Proc_ReceiveandDisposalMaster", "Purpose='Dispose' "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpParticulardispose.DataSource = DS; dpParticulardispose.DataBind(); dpParticulardispose.Items.Insert(0, new ListItem("--Select Particular --", "0")); } //DS = BindCommanData.BindCommanDropDwon("CenterID ", "CenterCode +' '+CenterName as Name ", "tbl_MilkCollectionCenter", "IsActive=1 "); //if (!Comman.Comman.IsDataSetEmpty(DS)) //{ // dpCenter.DataSource = DS; // dpCenter.DataBind(); // dpCenter.Items.Insert(0, new ListItem("--Select Center --", "0")); //} }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeData empData = new EmployeeData(); DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpRoute.DataSource = DS; dpRoute.DataBind(); dpRoute.Items.Insert(0, new ListItem("--All Route --", "0")); } DS = BindCommanData.BindCommanDropDwon("CategoryId", "CategoryName as Name", "Category", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBrand.DataSource = DS; dpBrand.DataBind(); dpBrand.Items.Insert(0, new ListItem("--All Brand--", "0")); } txtStartDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); txtEndDate.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); } if (Context.Session != null && Context.Session.IsNewSession == true && Page.Request.Headers["Cookie"] != null && Page.Request.Headers["Cookie"].IndexOf("ASP.NET_SessionId") >= 0) { // session has timed out, log out the user if (Page.Request.IsAuthenticated) { FormsAuthentication.SignOut(); } // redirect to timeout page Page.Response.Redirect("/Authentication/LoginT.aspx"); } }
protected void dpReportType_SelectedIndexChanged(object sender, EventArgs e) { DS = new DataSet(); if (dpReportType.SelectedItem.Value == "1") { DS = BindCommanData.BindCommanDropDwon("EmployeeID as ID", "EmployeeCode+' '+EmployeeName as Name", "employeemaster", "EmployeeId is not Null"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpEmployee.DataSource = DS; dpEmployee.DataBind(); dpEmployee.Items.Insert(0, new ListItem("--All Employee --", "0")); } } if (dpReportType.SelectedItem.Value == "2") { DS = BindCommanData.BindCommanDropDwon("AgentID as ID", "AgentCode+' '+AgentName as Name", "Agentmaster", "PaymentMode='Monthly'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpEmployee.DataSource = DS; dpEmployee.DataBind(); dpEmployee.Items.Insert(0, new ListItem("--All Agents--", "0")); } } }
public void bindDropDown() { DS = new DataSet(); productdata = new ProductData(); DS = BindCommanData.BindCommanDropDwon("AgentID", "AgentCode+' '+AgentName as Name", "AgentMaster", "IsArchive=0 and Isactive=1 and Agensytype='Agency' Order by AgentCode"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgent.DataSource = DS; dpAgent.DataTextField = "Name"; dpAgent.DataValueField = "AgentID"; dpAgent.DataBind(); dpAgent.Items.Insert(0, new ListItem("--Select Agent--", "0")); } DS = new DataSet(); productdata = new ProductData(); DS = BindCommanData.BindCommanDropDwon("TypeID", "TypeName", "TypeMaster", "IsArchive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpType.DataSource = DS; dpType.DataTextField = "TypeName"; dpType.DataValueField = "TypeID"; dpType.DataBind(); dpType.Items.Insert(0, new ListItem("--Select TypeName --", "0")); } DS = new DataSet(); productdata = new ProductData(); DS = BindCommanData.BindCommanDropDwon("SlabID", "SlabName", "SlabMaster", "IsArchive=0"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpSlab.DataSource = DS; dpSlab.DataTextField = "SlabName"; dpSlab.DataValueField = "SlabID"; dpSlab.DataBind(); dpSlab.Items.Insert(0, new ListItem("--Select SlabName --", "0")); } }
public void BindDropDwon() { DS = BindCommanData.BindCommanDropDwon("TM_Id", "VehicleNo", "tblTransportMaster", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVehicleNo.DataSource = DS; dpVehicleNo.DataBind(); dpVehicleNo.Items.Insert(0, new ListItem("--Select Vehicle Number--", "0")); } DS = BindCommanData.BindCommanDropDwon("Id", "fuelpumpname", "Tr_Fuelpumpmaster", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpRegisterpump.DataSource = DS; dpRegisterpump.DataTextField = "fuelpumpname"; dpRegisterpump.DataValueField = "Id"; dpRegisterpump.DataBind(); dpRegisterpump.Items.Insert(0, new ListItem("Non Register Pump", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='FuelUnitType'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpUnitType.DataSource = DS; dpUnitType.DataTextField = "Name"; dpUnitType.DataValueField = "ID"; dpUnitType.DataBind(); dpUnitType.Items.Insert(0, new ListItem("--Select UnitType --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='FuelType'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpFuelType.DataSource = DS; dpFuelType.DataBind(); dpFuelType.Items.Insert(0, new ListItem("--Select Fuel Type --", "0")); } }
protected void BindDropDown() { RouteData routeData = new RouteData(); DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "Proc_MilkCollectionRoute", "IsActive=1 "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpRoute.DataSource = DS; dpRoute.DataBind(); dpRoute.Items.Insert(0, new ListItem("--Select Route --", "0")); dpRoute1.DataSource = DS; dpRoute1.DataBind(); dpRoute1.Items.Insert(0, new ListItem("--All Route --", "0")); } DS = BindCommanData.BindCommanDropDwon("SupplierID ", "SupplierCode +' '+SupplierName as Name ", "Proc_MilkSuppliersProfile", "IsActive=1 "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpSupplier.DataSource = DS; dpSupplier.DataBind(); dpSupplier.Items.Insert(0, new ListItem("--Select Supplier --", "0")); } }
protected void chkEmp_CheckedChanged(object sender, EventArgs e) { if (chkEmp.Checked) { DS = BindCommanData.BindCommanDropDwon("'E' + convert(nvarchar(max),EmployeeID) as EmployeeID ", " EmployeeCode +' '+EmployeeName as Name ", "EmployeeMaster", "IsActive = 1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { FirstList.DataValueField = "EmployeeID"; FirstList.DataTextField = "Name"; FirstList.DataSource = DS; FirstList.DataBind(); FirstList.Rows = FirstList.Items.Count; //FirstList.Items.Insert(0, new ListItem("--Select Route--", "0")); } else { FirstList.Items.Clear(); } } else { FirstList.Items.Clear(); } }
public void BindDropDwon() { DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=1 "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpagentRoute.DataSource = DS; dpagentRoute.DataBind(); dpagentRoute.Items.Insert(0, new ListItem("--Select Agent Route --", "0")); dpEmploueeRoute.DataSource = DS; dpEmploueeRoute.DataBind(); dpEmploueeRoute.Items.Insert(0, new ListItem("--Select Agent Route --", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("EmployeeID", "EmployeeCode+' '+EmployeeName as Name", "employeemaster", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { //dpAgentSelasEMployee.DataSource = DS; //dpAgentSelasEMployee.DataBind(); //dpAgentSelasEMployee.Items.Insert(0, new ListItem("--Select Agent Sales Person --", "0")); //dpEmploueeSalesPErsion.DataSource = DS; //dpEmploueeSalesPErsion.DataBind(); //dpEmploueeSalesPErsion.Items.Insert(0, new ListItem("--Select Employee Sales Person --", "0")); dpEmployee.DataSource = DS; dpEmployee.DataBind(); dpEmployee.Items.Insert(0, new ListItem("--Select Employee --", "0")); } DS = BindCommanData.BindCommanDropDwon("AgentID", "AgentCode+' '+AgentName as Name", "AgentMaster", "IsArchive=0 and Isactive=1 and Agensytype='Agency' Order by AgentCode"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgent.DataSource = DS; dpAgent.DataBind(); dpAgent.Items.Insert(0, new ListItem("--Select Agent --", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("CategoryId", "CategoryName", "Category", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBrand.DataSource = DS; dpBrand.DataBind(); dpBrand.Items.Insert(0, new ListItem("--Select Brand --", "0")); } DS.Clear(); DS = BindCommanData.BindCommanDropDwon("TypeID", "TypeName", "TypeMaster", "IsArchive=1 "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpAgentProductType.DataSource = DS; dpAgentProductType.DataBind(); dpAgentProductType.Items.Insert(0, new ListItem("--Select Product Type --", "0")); dpEmployeeProductType.DataSource = DS; dpEmployeeProductType.DataBind(); dpEmployeeProductType.Items.Insert(0, new ListItem("--Select Product Type --", "0")); } }
public void BindDropDown() { DS = new DataSet(); productdata = new ProductData(); DS = BindCommanData.BindCommanDropDwon("TypeID", "TypeName as Name", "TypeMaster", "IsArchive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpType.DataSource = DS; dpType.DataTextField = "Name"; dpType.DataValueField = "TypeID"; dpType.DataBind(); dpType.Items.Insert(0, new ListItem("--Select TypeName --", "0")); } DS = BindCommanData.BindCommanDropDwon("CategoryId", "CategoryName as Name", "Category", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBrand.DataSource = DS; dpBrand.DataBind(); dpBrand.Items.Insert(0, new ListItem("--Select Brand--", "0")); } //DS = BindCommanData.BindCommanDropDwon("StateID", "StateName", "State", "IsArchive=0"); //if (!Comman.Comman.IsDataSetEmpty(DS)) //{ // dpState.DataSource = DS; // dpState.DataTextField = "StateName"; // dpState.DataValueField = "StateID"; // dpState.DataBind(); // dpState.Items.Insert(0, new ListItem("--Select StateName --", "0")); //} DS = BindCommanData.BindCommanDropDwon("SlabID", "SlabName", "SlabMaster", "IsArchive=0"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpSlab.DataSource = DS; dpSlab.DataTextField = "SlabName"; dpSlab.DataValueField = "SlabID"; dpSlab.DataBind(); dpSlab.Items.Insert(0, new ListItem("--Select SlabName --", "0")); } DS = BindCommanData.BindCommanDropDwon("CommodityID", "CommodityName", "Commodity", "IsArchive=0"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpCommodity.DataSource = DS; dpCommodity.DataTextField = "CommodityName"; dpCommodity.DataValueField = "CommodityID"; dpCommodity.DataBind(); dpCommodity.Items.Insert(0, new ListItem("--Select Commodity--", "0")); } DS = BindCommanData.BindCommanDropDwon("UnitID", "UnitName", "Unit", "IsArchive=0"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpUnit.DataSource = DS; dpUnit.DataTextField = "UnitName"; dpUnit.DataValueField = "UnitID"; dpUnit.DataBind(); dpUnit.Items.Insert(0, new ListItem("--Select UnitName --", "0")); } DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("LocId", "State as Name", "StateMaster", "LocId is not null"); dpState.DataSource = DS; dpState.DataBind(); dpState.Items.Insert(0, new ListItem("--Select State--", "0")); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { btnAddTransportInfo.Visible = true; btnupdateTransportdetail.Visible = false; GetTransportDetails(); txtVeh_InsLast.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); txtVeh_InsStart.Text = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd")); DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='VehicleType'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVeh_Type.DataSource = DS; dpVeh_Type.DataBind(); dpVeh_Type.Items.Insert(0, new ListItem("--Select Vehicle Type --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='Insuranceprovider'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVeh_InsProvider.DataSource = DS; dpVeh_InsProvider.DataBind(); dpVeh_InsProvider.Items.Insert(0, new ListItem("--Select Insurance Provider --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='Fueltype'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVeh_FuelType.DataSource = DS; dpVeh_FuelType.DataBind(); dpVeh_FuelType.Items.Insert(0, new ListItem("--Select Fuel Type --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='Ownershiptype'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVeh_OwnershipType.DataSource = DS; dpVeh_OwnershipType.DataBind(); dpVeh_OwnershipType.Items.Insert(0, new ListItem("--Select Ownership Type --", "0")); } DS = BindCommanData.BindCommanDropDwon("tr_brand_Id ", "tr_brand_name as Name ", "Tr_Brand_Master", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVehicleBrand.DataSource = DS; dpVehicleBrand.DataBind(); dpVehicleBrand.Items.Insert(0, new ListItem("--Select Vehicle Brand --", "0")); } DS = BindCommanData.BindCommanDropDwon("tr_model_Id ", "tr_model_name as Name ", "Tr_Model_Master", "IsActive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpVeh_Model.DataSource = DS; dpVeh_Model.DataBind(); dpVeh_Model.Items.Insert(0, new ListItem("--Select Vehicle Model --", "0")); } DS = BindCommanData.BindCommanDropDwon("ID ", "CONFIGVALUE as Name ", "CONFIGMASTER", "ISACTIVE=1 and CONFIGNAME='Transport' and CONFIGKEY='BankName'"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpBank.DataSource = DS; dpBank.DataBind(); dpBank.Items.Insert(0, new ListItem("--Select BankName --", "0")); } } }
protected void BindDropDwon() { DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("LocId", "City as Name", "StateMaster", "LocId is not null"); dpCity.DataSource = DS; dpCity.DataBind(); dpCity.Items.Insert(0, new ListItem("--Select City--", "0")); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("LocId", "District as Name", "StateMaster", "LocId is not null"); dpDistric.DataSource = DS; dpDistric.DataBind(); dpDistric.Items.Insert(0, new ListItem("--Select District--", "0")); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("LocId", "State as Name", "StateMaster", "LocId is not null"); dpState.DataSource = DS; dpState.DataBind(); dpState.Items.Insert(0, new ListItem("--Select State--", "0")); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("LocId", "Country as Name", "StateMaster", "LocId is not null"); dpCountry.DataSource = DS; dpCountry.DataBind(); dpCountry.Items.Insert(0, new ListItem("--Select Country--", "0")); RouteData routeData = new RouteData(); DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=1 "); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpRoute.DataSource = DS; dpRoute.DataBind(); dpRoute.Items.Insert(0, new ListItem("--Select Route --", "0")); } DS.Clear(); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("ID", "BankName as Name", "BankDetails", "ID is not null"); dpBankName.DataSource = DS; dpBankName.DataBind(); dpBankName.Items.Insert(0, new ListItem("--Select Bank Name--", "0")); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwonDistinct("ID", "IFSCCode as Name", "BankDetails", "ID is not null"); dpIfscCode.DataSource = DS; dpIfscCode.DataBind(); dpIfscCode.Items.Insert(0, new ListItem("--Select Ifsc Code--", "0")); DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("TypeID", "TypeName", "TypeMaster", "IsArchive=1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpType.DataSource = DS; dpType.DataTextField = "TypeName"; dpType.DataValueField = "TypeID"; dpType.DataBind(); dpType.Items.Insert(0, new ListItem("--Select TypeName --", "0")); } DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("SlabID", "SlabName", "SlabMaster", "IsArchive=0"); if (!Comman.Comman.IsDataSetEmpty(DS)) { dpSlab.DataSource = DS; dpSlab.DataTextField = "SlabName"; dpSlab.DataValueField = "SlabID"; dpSlab.DataBind(); dpSlab.Items.Insert(0, new ListItem("--Select SlabName --", "0")); } //EmployeeData empData = new EmployeeData(); //DS = BindCommanData.BindCommanDropDwon("RouteID ", "RouteCode +' '+RouteName as Name ", "routeMaster", "IsArchive=0"); //if (!Comman.Comman.IsDataSetEmpty(DS)) //{ // dpEmployeeID.DataSource = DS; // dpEmployeeID.DataBind(); // dpEmployeeID.Items.Insert(0, new ListItem("--Select Employee --", "0")); //} }
protected void dpagentRoute_SelectedIndexChanged(object sender, EventArgs e) { DS = new DataSet(); DS = BindCommanData.BindCommanDropDwon("OrderID", "OrderID as Name ", "OrderMaster", "OrderDate = '" + (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy") + "' and RouteID = " + dpagentRoute.SelectedItem.Value + "and IsPrinted = 1"); if (!Comman.Comman.IsDataSetEmpty(DS)) { btnAddAgentProductItem.Visible = false; btnagentItamsremove.Visible = false; btnAgentORderSubmit.Visible = false; dpagentRoute.ClearSelection(); upMain.Update(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage1", "alert('On This Route Orders are placed and Printed')", true); } else { if (dpAgent.SelectedItem.Value != "0") { Invoice invocie = new Invoice(); InvoiceData invicedata = new InvoiceData(); invocie.AgencyID = Convert.ToInt32(dpAgent.SelectedItem.Value); invocie.ROuteID = Convert.ToInt32(dpagentRoute.SelectedItem.Value); invocie.orderDate = (Convert.ToDateTime(txtGentOrderDate.Text)).ToString("dd-MM-yyyy"); DS = invicedata.GetPreviousDayOrder(invocie); if (!Comman.Comman.IsDataSetEmpty(DS)) { //RemoveAllItam(); deleteAllItem(); ScriptManager.RegisterStartupScript(Page, Page.GetType(), "11", "<script type='text/javascript'> $('#MainContent_dpAgent').attr('disabled', 'disabled'); </script>", false); //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "12", "<script type='text/javascript'> $('#MainContent_txtGentOrderDate').attr('disabled', 'disabled'); </script>", false); //ScriptManager.RegisterStartupScript(Page, Page.GetType(), "13", "<script type='text/javascript'> $('#MainContent_dpagentRoute').attr('disabled', 'disabled'); </script>", false); PrvAgentID = Convert.ToInt32(DS.Tables[0].Rows[0]["AgentID"]); Session["PrvOrderID"] = Convert.ToInt32(DS.Tables[0].Rows[0]["OrderID"]); // PrvOrderID = Convert.ToInt32(DS.Tables[0].Rows[0]["OrderID"]); //dpAgent.Enabled = false; foreach (DataRow row in DS.Tables[0].Rows) { invocie.TokanId = hftokanno.Value; invocie.UserID = GlobalInfo.Userid; invocie.ProductID = Convert.ToInt32(row["ProductID"]); invocie.qty = Convert.ToDouble(row["Qty"]); invocie.UnitCost = Convert.ToDouble(row["UnitCost"]); invocie.totalCoast = Convert.ToDouble(row["Total"]); invocie.TypeID = Convert.ToInt32(row["TypeID"]); totsum = totsum + Convert.ToDouble(row["Total"]); invicedata.InsertTempInvoiceItam(invocie); BindAgntTempItam(invocie); //txtagentOrderqty.Text = "0"; } } else { Session["PrvOrderID"] = 0; // PrvOrderID = 0; //RemoveAllItam(); deleteAllItem(); } } } dpagentRoute.Focus(); }