public void GetData(int i) { DataSet ds = new DataSet(); ds = OtherClass.Idv_Chetana_Get_Global_Commission(0, 0, 0, Convert.ToInt32(strFY)); if (i == 0) { if (ds.Tables[0].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[0]; GrdComm.DataBind(); } else { MessageBox("Kindly SET COMMISSION..."); } } else { if (ds.Tables[1].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[0]; GrdComm.DataBind(); } else { MessageBox("Kindly SET COMMISSION..."); } } //btnSave.Visible = true; }
protected void btnget_Click(object sender, EventArgs e) { if (Convert.ToInt32(DDLSuperZone.SelectedValue) <= 0) { MessageBox("Kindly select Superzone and Zone..."); } else { PnllGrdComm.Visible = true; DataSet ds = new DataSet(); Int32 sdzoneid = 0; Int32 szoneid = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()); Int32 zoneid = Convert.ToInt32(DDLZone.SelectedValue.ToString()); ds = OtherClass.Idv_Chetana_Get_Global_Commission(sdzoneid, szoneid, zoneid, Convert.ToInt32(strFY)); if (ds.Tables[1].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[1]; GrdComm.DataBind(); } else if (ds.Tables[0].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[0]; GrdComm.DataBind(); } else { MessageBox("Kindly SET COMMISSION..."); } } }
protected void btnadd_Click(object sender, EventArgs e) { btnSave.Visible = true; if (txtDisFrm.Text != "" || txtDisTo.Text != "" || txtTarFrm.Text != "" || txtTarTo.Text != "" || txtCommSZone.Text != "" || txtCommZone.Text != "") { Tdisfrm = txtDisFrm.Text.Trim(); Tdisto = txtDisTo.Text.Trim(); Ttarfrm = txtTarFrm.Text.Trim(); Ttarto = txtTarTo.Text.Trim(); Tscomm = txtCommSZone.Text.Trim(); Tzcomm = txtCommZone.Text.Trim(); if (chkActive.Checked) { TIsActive = true; } else { TIsActive = false; } DataTable dt1 = new DataTable(); if (Session["tempCommData"] != null) { Session["tempCommData"] = fillTempData(); dt1 = (DataTable)Session["tempCommData"]; } else { Session["tempCommData"] = fillTempData(); dt1 = (DataTable)Session["tempCommData"]; } GrdComm.DataSource = dt1; GrdComm.DataBind(); txtDisFrm.Text = ""; txtDisTo.Text = ""; txtTarFrm.Text = ""; txtTarTo.Text = ""; txtCommSZone.Text = ""; txtCommZone.Text = ""; txtDisFrm.Focus(); } else { MessageBox("Fill all text fields.."); } }
protected void btnget_Click(object sender, EventArgs e) { if (Convert.ToInt32(DDLSuperZone.SelectedValue) <= 0) { MessageBox("Kindly select Superzone and Zone..."); } else { PnllGrdComm.Visible = true; DataSet ds = new DataSet(); DataTable tbl; Int32 sdzoneid = Convert.ToInt32(ddlSDZone.SelectedValue.ToString()); Int32 szoneid = Convert.ToInt32(DDLSuperZone.SelectedValue.ToString()); Int32 zoneid = Convert.ToInt32(DDLZone.SelectedValue.ToString()); ds = OtherClass.Idv_Chetana_Get_Global_Commission(sdzoneid, szoneid, zoneid, Convert.ToInt32(strFY)); if (ds.Tables[1].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[1]; GrdComm.DataBind(); tbl = ds.Tables[1]; DataRow dr = tbl.Rows[0]; txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00"); } else if (ds.Tables[0].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[0]; GrdComm.DataBind(); tbl = ds.Tables[0]; DataRow dr = tbl.Rows[0]; txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00"); } else { //MessageBox("Kindly SET COMMISSION..."); } } }
public void GetData() { DataSet ds = new DataSet(); DataTable tbl; ds = OtherClass.Idv_Chetana_Get_Global_Commission(0, 0, 0, Convert.ToInt32(strFY)); if (ds.Tables[0].Rows.Count > 0) { GrdComm.DataSource = ds.Tables[0]; GrdComm.DataBind(); tbl = ds.Tables[0]; DataRow dr = tbl.Rows[0]; txtcnper.Text = dr["CNPer"].ToString() == "" ? "0.00" : Convert.ToDecimal(dr["CNPer"]).ToString("0.00"); } else { MessageBox("Kindly SET COMMISSION..."); } }