protected void GrdDetails_RowDeleting(object sender, GridViewDeleteEventArgs e) { Masterofmaster _objMM = new Masterofmaster(); _objMM.AutoId = Convert.ToInt32(((Label)GrdDetails.Rows[e.RowIndex].FindControl("lblAutoID")).Text); _objMM.Value = ((Label)GrdDetails.Rows[e.RowIndex].FindControl("lblName")).Text; _objMM.key = ((Label)GrdDetails.Rows[e.RowIndex].FindControl("lblCode")).Text; _objMM.Group = ((Label)GrdDetails.Rows[e.RowIndex].FindControl("lblGroup")).Text; _objMM.Description = ((Label)GrdDetails.Rows[e.RowIndex].FindControl("lblDesc")).Text; _objMM.IsActive = ((CheckBox)GrdDetails.Rows[e.RowIndex].FindControl("chkIsActive")).Checked; _objMM.IsActive = Convert.ToBoolean(false); _objMM.IsDeleted = Convert.ToBoolean(true); try { _objMM.Save(); // MessageBox("Your record is Deleted"); BindGvDetail(); Panel1.Visible = false; Panel2.Visible = true; } catch { } }
public void BindDDL() { string grp = "BookSet"; DDLSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); DDLSet.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["ChetanaCompanyName"] != null) { if (Session["FY"] != null) { if (!Page.IsPostBack) { strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); UserName = Session["UserName"].ToString(); Cust_AutoCompleteExtender.ContextKey = "custz" + "!" + Session["UserName"].ToString(); //txtOrderRecdDate.Text = System.DateTime.Now.ToString("dd/MM/yyyy"); //txtOrderRecdDate.Focus(); txtCustCode.Focus(); string grp = "Transport"; txtTransport.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); txtTransport.DataBind(); txtTransport.Items.Insert(0, new ListItem("-Select Transporter-", "0")); } } else { Session.Clear(); } } }
// Bind Dropdown : Transport Details. public void BindDDlTransport() { string grp = "Transport"; DDlTransport.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); DDlTransport.DataBind(); DDlTransport.Items.Insert(0, new ListItem("-Select Transporter-", "none")); }
public void BindBooktype() { string grp = "BookType"; DDlBooktype.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); DDlBooktype.DataBind(); DDlBooktype.Items.Insert(0, new ListItem("-Select book set-", "0")); }
public void custRating() { DataView dv1 = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("CustRating").Tables[0]); DdlCustRating.DataSource = dv1; DdlCustRating.DataBind(); DdlCustRating.Items.Insert(0, new ListItem("--Select Rating--", "0")); }
public void BindDDLstd() { string std = "Standard"; DDLstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown"); DDLstandard.DataBind(); DDLstandard.Items.Insert(0, new ListItem("-STD-", "0")); }
public void fillddlVat() { DataSet ds = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("pvm", ddlmsoms.SelectedValue.ToString()); ddlVat.DataSource = ds; ddlVat.DataBind(); //ddlvatText.DataSource = ds; //ddlvatText.DataBind(); }
public void fillDesignation() { DataView dv1 = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("Designation").Tables[0]); dv1.RowFilter = "IsActive = 1"; DDlDesignation.DataSource = dv1; DDlDesignation.DataBind(); DDlDesignation.Items.Insert(0, new ListItem("--Select Designation--", "0")); }
public void fillQualification() { DataView dv = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("Qualification").Tables[0]); dv.RowFilter = "IsActive = 1"; ddlqulification.DataSource = dv; ddlqulification.DataBind(); ddlqulification.Items.Insert(0, new ListItem("--Select Qualification--", "0")); }
protected void txtTransporter_TextChanged(object sender, EventArgs e) { try { if (txttransporter.Text != "") { string TransCode = txttransporter.Text.ToString().Split(':', '[', ']')[0].Trim(); flag1 = txttransporter.Text.ToString().Split('[', ']')[1].Trim(); txttransporter.Text = TransCode; // ACExttransporter.ContextKey = TransCode; if (flag1 == "Trans") { lbltransporter.Visible = true; DataTable dt = new DataTable(); dt = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("Transport", TransCode).Tables[0]; if (dt.Rows.Count != 0) { // txttransporter.Text = TransCode; if (flag1 == "Trans") { lbltransporter.Text = dt.Rows[0]["Value"].ToString(); lblTransID.Text = dt.Rows[0]["AutoID"].ToString(); txtNoOfBund.Focus(); } } else { lbltransporter.Text = "No such record found"; txttransporter.Focus(); txttransporter.Text = ""; } // Bind_DDL_Transport(); } else { lbltransporter.Visible = false; lbltransporter.Text = flag1; //lbltransporter.Text = ""; } } else { lbltransporter.Text = "No such record found"; txttransporter.Text = ""; } } catch (Exception ex) { txttransporter.Text = ex.Message.ToString(); //lbltransporter.Text = "No such record found"; } }
public void callTextChange() { string CustCode = txtCust.Text.ToString().Split(':')[0].Trim(); DataTable dt = new DataTable(); if (rdoview.Items[0].Selected == true) { dt = DCMaster.Get_Name(CustCode, "Customer").Tables[0]; if (dt.Rows.Count != 0) { if (Convert.ToString(dt.Rows[0]["BlackList"]).ToLower() != "true") { lblCustomer.Text = Convert.ToString(dt.Rows[0]["CustName"]); txtCust.Text = CustCode; lblCustID.Text = Convert.ToString(dt.Rows[0]["CustID"]); txtCust.Focus(); } else { lblCustomer.Text = "Customer is blacklisted"; txtCust.Focus(); txtCust.Text = ""; } } else { lblCustomer.Text = "No such record found"; txtCust.Focus(); txtCust.Text = ""; } } else if (rdoview.Items[2].Selected == true) { dt = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("Transport", CustCode).Tables[0]; if (dt.Rows.Count != 0) { // txttransporter.Text = TransCode; lblCustomer.Text = dt.Rows[0]["Key"].ToString() + "::" + dt.Rows[0]["Value"].ToString(); lblCustID.Text = dt.Rows[0]["AutoID"].ToString(); } else { lblCustomer.Text = "No such record found"; txtCust.Focus(); txtCust.Text = ""; } } }
//} protected void gvPayment_RowDataBound(object sender, GridViewRowEventArgs e) { DropDownList ddlGivenFrom;// = (DropDownList)sender; if (e.Row.RowType == DataControlRowType.DataRow) { ddlGivenFrom = (DropDownList)e.Row.FindControl("ddlGivenFrom"); DataView dv = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("GivenFrom", "DropDown").Tables[0]); ddlGivenFrom.DataSource = dv; ddlGivenFrom.DataBind(); ddlGivenFrom.Items.Insert(0, new ListItem("Select", "0")); } }
protected void Page_Load(object sender, EventArgs e) { SetView(); if (!Page.IsPostBack) { DDLexpensetype.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("ExpenseType", "DropDown"); DDLexpensetype.DataBind(); DDLexpensetype.Items.Insert(0, new ListItem("--Select Type--", "0")); ddlexpensegroup.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("ExpenseGroup", "DropDown"); ddlexpensegroup.DataBind(); ddlexpensegroup.Items.Insert(0, new ListItem("--Select Group--", "0")); BindgrdExpense(); lblID.Text = "0"; } }
public void BindGvDetail() { setActiveUrl(); if (Group == "PVM") { GrdDetails.Columns[2].Visible = true; GrdDetails.Columns[1].HeaderStyle.Width = 20; GrdDetails.Columns[1].HeaderText = "(%)"; } else { GrdDetails.Columns[2].Visible = false; } GrdDetails.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup(Group); GrdDetails.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null) { if (Session["FY"] != "" || Session["FY"] != null) { strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); } else { Session.Clear(); } //Response.Write(strFY); } if (!Page.IsPostBack) { ViewState["srate"] = ""; SetView(); GetValidation(3, Convert.ToInt32(Session["Role"])); string grp = "BookSet"; DDLSelectSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); DDLSelectSet.DataBind(); DDLSelectSet.Items.Insert(0, new ListItem("-Select book set-", "0")); string std = "Standard"; DDlstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown"); DDlstandard.DataBind(); DDlstandard.Items.Insert(0, new ListItem("-STD-", "0")); txtdocDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtChalDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtOrdDate.Text = DateTime.Now.ToString("dd/MM/yyyy"); txtorder.Focus(); Session["tempBookData"] = null; // btncancel.Visible = false; //Session["tempBookData"] = null; } if (add) { btn_Save.Enabled = true; } if (!view) { BtnGetSpecimanDetails.Enabled = false; } }
public DataTable fillTempBookData(string Cust) { DataTable dt = new DataTable(); if (rdoview.Items[0].Selected == true) { DataTable dt1 = DCMaster.Get_Name(Cust, "Customer").Tables[0]; if (Session["getpasstempdata"] == null) { //CREATE NEW DATATABLE dt.Columns.Add("SCHL_ID"); dt.Columns.Add("SCHL_NAME"); dt.Columns.Add("SCHL_AREA"); dt.Columns.Add("ID"); } else { dt = (DataTable)Session["getpasstempdata"]; } dt.Rows.Add(dt1.Rows[0]["CustCode"].ToString(), dt1.Rows[0]["CustName"].ToString(), dt1.Rows[0]["AreaName"].ToString(), dt1.Rows[0]["CustID"].ToString()); } else if (rdoview.Items[2].Selected == true) { DataTable dt2 = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("Transport", Cust).Tables[0]; if (Session["getpasstempdata"] == null) { //CREATE NEW DATATABLE dt.Columns.Add("Transport_ID"); dt.Columns.Add("Transport_Code"); dt.Columns.Add("Transport_Name"); } else { dt = (DataTable)Session["getpasstempdata"]; } dt.Rows.Add(dt2.Rows[0]["AutoID"].ToString(), dt2.Rows[0]["Key"].ToString(), dt2.Rows[0]["Value"].ToString()); } Session["getpasstempdata"] = dt; return(dt); }
protected void Page_Load(object sender, EventArgs e) { if (Session["ChetanaCompanyName"] != "" || Session["ChetanaCompanyName"] != null) { if (Session["FY"] != "" || Session["FY"] != null) { strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); } else { Session.Clear(); } } if (!Page.IsPostBack) { GetValidation(3, Convert.ToInt32(Session["Role"])); ModalPopUpDocNum.Show(); TxtDocNo.Focus(); string grp = "BookSet"; DDLSelectSet.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); DDLSelectSet.DataBind(); DDLSelectSet.Items.Insert(0, new ListItem("-Select book set-", "0")); string std = "Standard"; DDLstandard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(std, "DropDown"); DDLstandard.DataBind(); DDLstandard.Items.Insert(0, new ListItem("-STD-", "0")); // txtdocDate.Text = DateTime.Now.ToString(sDateFormat); txtChalDate.Text = DateTime.Now.ToString(sDateFormat); // txtDeliverydte.Text = DateTime.Now.ToString(sDateFormat); // txtOrdDate.Text = DateTime.Now.ToString(sDateFormat); //txtorder.Focus(); Session["tempDCData"] = null; // Openpopup(2).; // btncancel.Visible = false; //Session["tempDCData"] = null; Bindcustomer(); // DCMaster.Get_Transporter(custcode); lblZoneCode.Visible = false; DDLZone.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["FY"] != null) { if (!Page.IsPostBack) { strFY = Session["FY"].ToString(); txtFrom.Focus(); string grp = "Transport"; txtTransport.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown(grp, "DropDown"); txtTransport.DataBind(); txtTransport.Items.Insert(0, new ListItem("-Select Transporter-", "0")); } } else { Session.Clear(); } }
protected void txtempc_TextChanged(object sender, EventArgs e) { string ECode = txtempc.Text.Split(Constants.splitseperator)[0].ToString().Trim(); DataTable dt = new DataTable(); dt = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("Teamdetails", ECode).Tables[0]; if (dt.Rows.Count != 0) { txtempc.Text = ECode; lblEmpName.Text = dt.Rows[0]["Value"].ToString(); txtremark.Focus(); } else { lblEmpName.Text = "No Such Teamfound"; txtempc.Focus(); txtempc.Text = ""; } }
protected void Page_Load(object sender, EventArgs e) { if (Session["FY"] != null) { // strChetanaCompanyName = Session["ChetanaCompanyName"].ToString(); strFY = Session["FY"].ToString(); } else { Session.Clear(); } //Response.Write(strFY); if (!Page.IsPostBack) { DDLScheme.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Scheme").Tables[0]; DDLScheme.DataBind(); DDLScheme.Items.Insert(0, new ListItem("--Select Scheme--", "0")); SetView(); } }
public void Bind_DDl_Board() { ddlBoard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Board").Tables[0]; ddlBoard.DataBind(); ddlBoard.Items.Insert(0, new ListItem("--Select Board--", "0")); }
//public void Bind_DDL_ZoneCust() //{ // DDLZone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(0, "Zone"); // DDLZone.DataBind(); // DDLZone.Items.Insert(0, new ListItem("-Select Zone-", "0")); // ddlCustmore.Items.Insert(0, new ListItem("-Select Customer-", "0")); //} //public void Bind_DDL_Customer() //{ // ddlCustmore.DataSource = Masters.Idv_Chetana_Get_ZoneCustomer(Convert.ToInt32(DDLZone.SelectedValue.ToString())); // ddlCustmore.DataBind(); // ddlCustmore.Items.Insert(0, new ListItem("-Select Customer-", "0")); //} public void Bind_DDl_Scheme() { DDLScheme.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Scheme").Tables[0]; DDLScheme.DataBind(); DDLScheme.Items.Insert(0, new ListItem("--Select Scheme--", "0")); }
private void GetSBUCode() { ddlSbucode.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("SBU", "DropDown"); ddlSbucode.DataBind(); ddlSbucode.Items.Insert(0, new ListItem("--Seelct SBU Code--", "0")); }
protected void btnSave_Click(object sender, EventArgs e) { setActiveUrl(); Masterofmaster _objMoM = new Masterofmaster(); _objMoM.AutoId = Convert.ToInt32(lblID.Text); _objMoM.key = txtkey.Text.Trim(); _objMoM.Value = txtvalue.Text.Trim(); if (Group == "PVM") { _objMoM.Description = txtdecp.Text.Trim() + "#" + ddlMSOms.SelectedValue.ToString(); } else { _objMoM.Description = txtdecp.Text.Trim(); } _objMoM.Group = Group; _objMoM.IsActive = chkActive.Checked; // txtkey.Enabled = false; try { if (lblID.Text == "0") { if (txtkey.Text != "") { _objMoM.Save(); } MessageBox("Record saved successfully"); txtkey.Text = ""; txtvalue.Text = ""; txtdecp.Text = ""; chkActive.Checked = false; filter.Visible = false; BindGvDetail(); Panel2.Visible = false; Panel1.Visible = true; btnSave.Text = "Save"; } else { if (lblID.Text != "0") { if (txtkey.Text != "") { _objMoM.Save(); } MessageBox("Record updated successfully"); chkActive.Checked = false; filter.Visible = true; BindGvDetail(); Panel2.Visible = true; Panel1.Visible = false; } } // filter.Visible = true; } catch { } }
protected void grdCustDetails_RowEditing(object sender, GridViewEditEventArgs e) { try { DDLareazone.Enabled = true; DDLarea.Enabled = true; DDLzone.Enabled = true; btnSave.Visible = true; btnSave.Text = "Update"; filter.Visible = false; btnSave.Enabled = true; PnlDetails.Visible = false; PnlAdd.Visible = true; repAlfabets.Visible = false; TxtCustCode.Enabled = false; LblCustId.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblCustID")).Text; TxtCustCode.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblCustCode")).Text; TxtShortForm.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblShortForm")).Text; TxtFamilyCode.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblFamilyCode")).Text; TxtAddress.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblAddress")).Text; TxtZip.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblZip")).Text; TxtPhone1.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblPhone1")).Text; TxtPhone2.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblPhone2")).Text; TxtEmailID.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblEmailID")).Text; TxtCustName.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblCustName")).Text; TxtCreditLimit.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblCreditLimit")).Text; TxtPrincipalName.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblPrincipalName")).Text; TxtPrincipalMobile.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblPrincipalMobile")).Text; TxtPrincipalDOB.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblPrincipalDOB")).Text; TxtKeyPersonName.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblKeyPersonName")).Text; TxtKeyPersonMobile.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblKeyPersonMobile")).Text; TxtKeyPersonDOB.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblKeyPersonDOB")).Text; TxtAdditinalDis.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblAdditinalDis")).Text; TxtVIPRemark.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblVIPRemark")).Text; TxtMedium.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblMedium")).Text; ChkIsActive.Checked = ((CheckBox)grdCustDetails.Rows[e.NewEditIndex].FindControl("chkisActive")).Checked; LblSuperzone.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblSuperZoneID")).Text; Lblzone.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblZoneID")).Text; LblAreazone.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblAreaZoneID")).Text; LblArea.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblAreaID")).Text; LblCustDetailID1.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("LblCustDetailID")).Text; TxtCustomerType.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblctype")).Text; txtcreditdays.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblcreditdays")).Text; lblrating.Text = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblcustrating")).Text; try { DDLsuperzone.SelectedValue = LblSuperzone.Text.Trim(); DDLzone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblSuperzone.Text), "Zone"); DDLzone.DataBind(); DDLzone.Items.Insert(0, new ListItem("--Select Zone--", "0")); DDLzone.SelectedValue = Lblzone.Text.Trim(); DDLareazone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(Lblzone.Text), "AreaZone"); DDLareazone.DataBind(); DDLareazone.Items.Insert(0, new ListItem("--Select AreaZone--", "0")); DDLareazone.SelectedValue = LblAreazone.Text.Trim(); DDLarea.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblAreazone.Text), "Area"); DDLarea.DataBind(); DDLarea.Items.Insert(0, new ListItem("--Select Area--", "0")); DDLarea.SelectedValue = LblArea.Text.Trim(); } catch { } ddLStates.DataSource = Destination.GetDestination(flag); ddLStates.DataBind(); ddLStates.Items.Insert(0, new ListItem("--Select State--", "0")); ddLStates.SelectedValue = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblstate1")).Text.Trim(); ddlCity.DataSource = Destination.GetDestination(Convert.ToString(ddLStates.SelectedValue)); ddlCity.DataBind(); ddlCity.Items.Insert(0, new ListItem("--Select City--", "0")); ddlCity.SelectedValue = ((Label)grdCustDetails.Rows[e.NewEditIndex].FindControl("lblCity")).Text.Trim(); DataView dv1 = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("CustRating").Tables[0]); DdlCustRating.DataSource = dv1; DdlCustRating.DataBind(); DdlCustRating.Items.Insert(0, new ListItem("--Select Rating--", "0")); DdlCustRating.SelectedValue = lblrating.Text.Trim(); DDLCC.DataSource = CustCategory.GetCustomerCategoryMaster("adminCCM"); DDLCC.DataBind(); DDLCC.Items.Insert(0, new ListItem("--Select Category--", "0")); DDLCC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMID")).Text.Trim(); DDLCSC.DataSource = CustCategory.GetCustomerCategoryMaster("adminSubCCM"); DDLCSC.DataBind(); DDLCSC.Items.Insert(0, new ListItem("--Select Sub Category--", "0")); DDLCSC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMIDSUB")).Text.Trim(); } catch { } }
public void FillForm() { try { //DDLareazone.Enabled = true; //DDLarea.Enabled = true; //DDLzone.Enabled = true; //btnSave.Visible = true; PnlAdd.Visible = true; //PnlAdd.Enabled= false; //btnSave.Text = "Update"; //btnSave.Enabled = true; LblCustId.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCustID")).Text; TxtCustCode.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCustCode")).Text; TxtShortForm.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblShortForm")).Text; TxtFamilyCode.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblFamilyCode")).Text; TxtAddress.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblAddress")).Text; TxtZip.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblZip")).Text; TxtPhone1.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblPhone1")).Text; TxtPhone2.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblPhone2")).Text; TxtEmailID.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblEmailID")).Text; TxtCustName.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCustName")).Text; TxtCreditLimit.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCreditLimit")).Text; TxtPrincipalName.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalName")).Text; TxtPrincipalMobile.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalMobile")).Text; TxtPrincipalDOB.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblPrincipalDOB")).Text; TxtKeyPersonName.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonName")).Text; TxtKeyPersonMobile.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonMobile")).Text; TxtKeyPersonDOB.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblKeyPersonDOB")).Text; TxtAdditinalDis.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblAdditinalDis")).Text; TxtVIPRemark.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblVIPRemark")).Text; TxtMedium.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblMedium")).Text; ChkIsActive.Checked = ((CheckBox)grdCustDetails.Rows[0].FindControl("chkisActive")).Checked; LblSuperzone.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblSuperZoneID")).Text; Lblzone.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblZoneID")).Text; LblAreazone.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblAreaZoneID")).Text; LblArea.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblAreaID")).Text; LblCustDetailID1.Text = ((Label)grdCustDetails.Rows[0].FindControl("LblCustDetailID")).Text; TxtCustomerType.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblctype")).Text; txtcreditdays.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblcreditdays")).Text; lblrating.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblcustrating")).Text; txtSchAdditionalDis.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSchAdditionalDis")).Text; txtTODValue1.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue1")).Text; txtTODValue2.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue2")).Text; txtTODValue3.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODValue3")).Text; txtTODDisc1.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc1")).Text; txtTODDisc2.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc2")).Text; txtTODDisc3.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblTODDisc3")).Text; TxtblkRemark.Text = ((Label)grdCustDetails.Rows[0].FindControl("Lblblkremark")).Text; TxtblkDate.Text = ((Label)grdCustDetails.Rows[0].FindControl("Lblblkdate")).Text; txtUpperlimit.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCUL")).Text; txtLowerlimit.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblCLL")).Text; chk_splitdc.Checked = ((CheckBox)grdCustDetails.Rows[0].FindControl("chk_isSplit")).Checked; //ReadMe Comment(Zaid Ansari) Any Problem SBUCode Dropdown Bind Find This Method GetSBUCode() lblSBUCodeNone.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSUBCode")).Text == "" ? "0" : lblSBUCodeNone.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblSUBCode")).Text; txtPANNo.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblPan")).Text; txtGst.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblGst")).Text; txtStateCode.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblStateCode")).Text; try { //ReadMe Comment(Zaid Ansari)(Dropdown Bind) Super Zone ,State,City,Category Any Problem Find This Method fillzones() ddlSbucode.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup_ForDropdown("SBU", "DropDown"); ddlSbucode.DataBind(); ddlSbucode.Items.Insert(0, new ListItem("--Seelct SBU Code--", "0")); ddlSbucode.SelectedValue = lblSBUCodeNone.Text; DDLsuperzone.SelectedValue = LblSuperzone.Text; DDLzone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblSuperzone.Text), "Zone"); DDLzone.DataBind(); DDLzone.Items.Insert(0, new ListItem("--Select Zone--", "0")); DDLzone.SelectedValue = Lblzone.Text.Trim(); DDLareazone.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(Lblzone.Text), "AreaZone"); DDLareazone.DataBind(); DDLareazone.Items.Insert(0, new ListItem("--Select AreaZone--", "0")); DDLareazone.SelectedValue = LblAreazone.Text.Trim(); DDLarea.DataSource = Masters.Get_AreaZone_Zone_SuperZone(Convert.ToInt32(LblAreazone.Text), "Area"); DDLarea.DataBind(); DDLarea.Items.Insert(0, new ListItem("--Select Area--", "0")); DDLarea.SelectedValue = LblArea.Text.Trim(); } catch { } ddLStates.DataSource = Destination.GetDestination(flag); ddLStates.DataBind(); ddLStates.Items.Insert(0, new ListItem("--Select State--", "0")); ddLStates.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblstate1")).Text.Trim(); ddlCity.DataSource = Destination.GetDestination(Convert.ToString(ddLStates.SelectedValue)); ddlCity.DataBind(); ddlCity.Items.Insert(0, new ListItem("--Select City--", "0")); ddlCity.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCity")).Text.Trim(); DataView dv1 = new DataView(Masterofmaster.Get_MasterOfMaster_ByGroup("CustRating").Tables[0]); DdlCustRating.DataSource = dv1; DdlCustRating.DataBind(); DdlCustRating.Items.Insert(0, new ListItem("--Select Rating--", "0")); DdlCustRating.SelectedValue = lblrating.Text.Trim(); ChkBlacklist.Checked = ((CheckBox)grdCustDetails.Rows[0].FindControl("ChKBList")).Checked; //lblboardid.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblboardid")).Text; //DDLBoard.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Board").Tables[0]; //DDLBoard.DataBind(); //DDLBoard.Items.Insert(0, new ListItem("--Select Board--", "0")); //DDLBoard.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblboardid")).Text; txtassociation.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblassociation")).Text; txtcgp.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblcgp")).Text; txtbuisiness.Text = ((Label)grdCustDetails.Rows[0].FindControl("lblbuisiness")).Text; DDLCC.DataSource = CustCategory.GetCustomerCategoryMaster(flag); DDLCC.DataBind(); DDLCC.Items.Insert(0, new ListItem("--Select Category--", "0")); DDLCC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMID")).Text.Trim(); DDLCSC.DataSource = CustCategory.GetCustomerCategoryMaster(Convert.ToString(DDLCC.SelectedValue)); DDLCSC.DataBind(); DDLCSC.Items.Insert(0, new ListItem("--Select City--", "0")); DDLCSC.SelectedValue = ((Label)grdCustDetails.Rows[0].FindControl("lblCMIDSUB")).Text.Trim(); } catch (Exception ex) { } }
private void setActiveUrl() { string pagename = Request.Url.Segments[Request.Url.Segments.Length - 1].ToLower(); if (pagename == "booktype.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Book Type "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Book Type "; } } Group = "BookType"; lblkey.Text = "BookType Code :"; lblvalue.Text = "BookType Name :"; lblBT_BMID.Visible = true; lblBT_BMID.Text = "Book Kind"; DDLBMID.Visible = true; DDLBMID.DataSource = Masterofmaster.GetBookKind("adminBKM"); DDLBMID.DataBind(); DDLBMID.Items.Insert(0, new ListItem("--Select Book Kind--", "0")); } else if (pagename == "bookgroup.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Book Group "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Book Group "; } } Group = "BookGroup"; lblkey.Text = "BookGroup Code :"; lblvalue.Text = "BookGroup Name :"; } else if (pagename == "department.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Department "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Department "; } } Group = "Department"; lblkey.Text = "Department Code :"; lblvalue.Text = "Department Name :"; } else if (pagename == "family.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Family "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Family "; } } Group = "Family"; lblkey.Text = "Family Code :"; lblvalue.Text = "Family Name :"; } else if (pagename == "bookset.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Bookset "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Bookset "; } } Group = "Bookset"; lblkey.Text = "BookSet Code :"; lblvalue.Text = "BookSet Name :"; } else if (pagename == "qualification.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Qualification "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Qualification "; } } Group = "Qualification"; lblkey.Text = "Qualification Code :"; lblvalue.Text = "Qualification Name :"; } else if (pagename == "medium.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Medium "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Medium "; } } Group = "Medium"; lblkey.Text = "Medium Code"; lblvalue.Text = "Medium Name"; } else if (pagename == "standard.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Standard "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Standard "; } } Group = "Standard"; lblkey.Text = "Standard Code"; lblvalue.Text = "Standard Name"; } else if (pagename == "transport.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Transport "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Transport "; } } Group = "Transport"; lblkey.Text = "Transport Code"; lblvalue.Text = "Transport Name"; } else if (pagename == "narration.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Narration "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Narration "; } } pageName.InnerHtml = "Narration"; Group = "Narration"; lblkey.Text = "Narration Code"; lblvalue.Text = "Narration Name"; } else if (pagename == "designation.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Designation "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Designation "; } } Group = "Designation"; lblkey.Text = "Designation Code"; lblvalue.Text = "Designation Name"; } else if (pagename == "customertype.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Customer Type "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Customer Type "; } } Group = "CUSTOMERTYPE"; lblkey.Text = "Customer Type Code"; lblvalue.Text = "Customer Type Name"; } else if (pagename == "customerrating.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Customer Rating"; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Customer Rating"; } } Group = "CustRating"; lblkey.Text = "Customer Rating Code"; lblvalue.Text = "Customer Rating"; } else if (pagename == "expensehead.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD ExpenseHead"; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit ExpenseHead"; } } Group = "ExpenseHead"; lblkey.Text = "ExpenseHead Code"; lblvalue.Text = "ExpenseHead Name"; } else if (pagename == "board.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Board "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Board "; } } Group = "Board"; lblkey.Text = "Board Code"; lblvalue.Text = "Board Name"; } else if (pagename == "scheme.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Scheme "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Scheme "; } } Group = "Scheme"; lblkey.Text = "Scheme Code"; lblvalue.Text = "Scheme Name"; chExtra.Visible = true; chExtra.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup("Product"); chExtra.DataTextField = "value"; chExtra.DataValueField = "AutoId"; chExtra.DataBind(); lblExtra.Text = " Products "; lblExtra.Visible = true; } else if (pagename == "productmaster.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Product "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Product "; } } Group = "Product"; lblkey.Text = "Product Code :"; lblvalue.Text = "Product Name :"; } else if (pagename == "bookkind.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD Book Kind "; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Book Kind "; } } Group = "BookKind"; lblkey.Text = "Book Kind Code :"; lblvalue.Text = "Book Kind Name :"; } else if (pagename == "courier_company_master.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "Add Courier Company"; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit Courier Company"; } } Group = "CourierCompany"; lblkey.Text = "Courier Company Code :"; lblvalue.Text = "Courier Company Name :"; } else if (pagename == "sbu.aspx") { if (Request.QueryString["a"] != null) { if (Request.QueryString["a"] == "a") { pageName.InnerHtml = "ADD SBU"; } else if (Request.QueryString["a"] == "v") { pageName.InnerHtml = "View / Edit SBU"; } } Group = "SBU"; lblkey.Text = "SBU Code :"; lblvalue.Text = "SBU Name :"; } else { } lblCoder.Text = Group; }
public void BindGvDetail() { setActiveUrl(); GrdDetails.DataSource = Masterofmaster.Get_MasterOfMaster_ByGroup(Group); GrdDetails.DataBind(); }
protected void btnSave_Click(object sender, EventArgs e) { //setActiveUrl(); Masterofmaster _objMoM = new Masterofmaster(); _objMoM.AutoId = Convert.ToInt32(lblID.Text); _objMoM.key = txtkey.Text.Trim(); _objMoM.Value = txtvalue.Text.Trim(); _objMoM.Description = txtdecp.Text.Trim(); _objMoM.Group = Group; _objMoM.IsActive = chkActive.Checked; if (Group == "BookType") { _objMoM.BKID = Convert.ToInt32(DDLBMID.SelectedItem.Value); } // txtkey.Enabled = false; string strProductIDs = string.Empty; //if it is scheme { if (_objMoM.Group.ToLower() == "scheme".ToLower()) { foreach (ListItem i in chExtra.Items) { if (i.Selected == true) { strProductIDs += i.Value + ","; } } } } strProductIDs = strProductIDs + "0"; _objMoM.UpdatedBy = strProductIDs; try { if (lblID.Text == "0") { if (txtkey.Text != "") { _objMoM.Save(); } MessageBox("Record saved successfully"); txtkey.Text = ""; txtvalue.Text = ""; txtdecp.Text = ""; chkActive.Checked = false; filter.Visible = false; BindGvDetail(); Panel2.Visible = false; Panel1.Visible = true; btnSave.Text = "Save"; } else { if (lblID.Text != "0") { if (txtkey.Text != "") { _objMoM.Save(); } MessageBox("Record updated successfully"); chkActive.Checked = false; filter.Visible = true; BindGvDetail(); Panel2.Visible = true; Panel1.Visible = false; } } // filter.Visible = true; } catch { } }