protected void lnkbtnSearch_OnClick(object sender, EventArgs e)
        {
            try
            {
                LorryHireDAL obj           = new LorryHireDAL();
                Int64        LorryIdno     = Convert.ToInt64(ddllorryno.SelectedValue);
                Int32        ifromCityIdno = Convert.ToInt32(ddlFromCity.SelectedValue);
                DataTable    DsGrdetail;

                DsGrdetail = obj.SelectGRDetailTruckNo("SelectGRDetailTruckNo", Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(txtDateFrom.Text.Trim()), Convert.ToString(txtDateTo.Text), ifromCityIdno, LorryIdno, ApplicationFunction.ConnectionString());



                if ((DsGrdetail != null) && (DsGrdetail.Rows.Count > 0))
                {
                    grdGrdetals.DataSource = DsGrdetail;
                    grdGrdetals.DataBind();
                    lnkbtnSubmit.Visible = true; lnkbtnCloase.Visible = true;
                }
                else
                {
                    grdGrdetals.DataSource = null;
                    grdGrdetals.DataBind();
                    lnkbtnSubmit.Visible = false; lnkbtnCloase.Visible = false;
                }
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                lnkbtnSearch.Focus();
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
Ejemplo n.º 2
0
 protected void lnkbtnSearchClick_OnClick(object sender, EventArgs e)
 {
     try
     {
         chkSelectAllRows.Checked = false;
         SummaryRegisterDAL obj = new SummaryRegisterDAL();
         Int64     Tocity       = Convert.ToInt64((ddlFromCity.SelectedValue) == "" ? 0 : Convert.ToInt64(ddlFromCity.SelectedValue));
         DataTable DsGrdetail   = obj.SelectChlnDetail("SelectChlnDetail", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFromDiv.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateToDiv.Text)), Tocity, ApplicationFunction.ConnectionString());
         if ((DsGrdetail != null) && (DsGrdetail.Rows.Count > 0))
         {
             grdGrdetals.DataSource = DsGrdetail;
             grdGrdetals.DataBind(); //BtnClerForPurOdr.Visible = true;
             // btnSubmit.Visible = true; chkSelectAllRows.Visible = true;
         }
         else
         {
             grdGrdetals.DataSource = null;
             grdGrdetals.DataBind();// BtnClerForPurOdr.Visible = false;
             // btnSubmit.Visible = false; chkSelectAllRows.Visible = false;
         }
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
     }
     catch (Exception Ex)
     {
         ApplicationFunction.ErrorLog(Ex.Message);
     }
 }
Ejemplo n.º 3
0
        protected void lnkbtnSearch_OnClick(object sender, EventArgs e)
        {
            try
            {
                grdGrdetals.DataSource = null;
                grdGrdetals.DataBind();

                Int32    YearIdno  = Convert.ToInt32(ddldateRange.SelectedValue);
                DateTime DtFrom    = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text));
                DateTime DtTo      = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text));
                Int64    DelvPlace = Convert.ToInt64(ddldelvplace.SelectedValue);

                DeliveryChallanDetailsDAL Obj = new DeliveryChallanDetailsDAL();
                var Lst = Obj.SearchGR(YearIdno, DtFrom, DtTo, DelvPlace);
                if (Lst != null && Lst.Count > 0)
                {
                    grdGrdetals.DataSource = Lst;
                    grdGrdetals.DataBind();
                    lnkbtnokClick.Visible = true;
                }
                else
                {
                    lnkbtnokClick.Visible = false;
                }
                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
Ejemplo n.º 4
0
 protected void lnkbtnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         RcvdAmntAgnstGRDAL obj = new RcvdAmntAgnstGRDAL();
         Int64  iPRTYIDNO       = (ddlPartyName.SelectedIndex <= 0 ? 0 : Convert.ToInt64(ddlPartyName.SelectedValue));
         Int32  iFromcity       = (ddlFromCity.SelectedIndex <= 0 ? 0 : Convert.ToInt32(ddlFromCity.SelectedValue));
         string strGrFrm        = "";
         strGrFrm = "BK";
         DataTable DsGrdetail = obj.SelectGRPaymentDetail("SelectGRPaymentDetail", Convert.ToInt32(ddldateRange.SelectedValue), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), iPRTYIDNO, strGrFrm, iFromcity, ApplicationFunction.ConnectionString());
         if ((DsGrdetail != null) && (DsGrdetail.Rows.Count > 0))
         {
             grdGrdetals.DataSource = DsGrdetail;
             grdGrdetals.DataBind();
             lnkbtnsubmit.Visible = true;
             lblTotalRecord.Text  = "T. Record(s) : " + Convert.ToString(DsGrdetail.Rows.Count);
         }
         else
         {
             grdGrdetals.DataSource = null;
             grdGrdetals.DataBind();
             lnkbtnsubmit.Visible = false;
             lblTotalRecord.Text  = "T. Record(s) : 0";
         }
         ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
     }
     catch (Exception Ex)
     {
         ApplicationFunction.ErrorLog(Ex.Message);
     }
 }
Ejemplo n.º 5
0
        protected void lnkbtnSearch_OnClick(object sender, EventArgs e)
        {
            try
            {
                FreightMemoDAL obj         = new FreightMemoDAL();
                Int32          iToCityIdno = (ddlToCity.SelectedIndex <= 0 ? 0 : Convert.ToInt32(ddlToCity.SelectedValue));
                string         strAction   = "";
                string         StrGrno     = "";
                StrGrno = txtSrchGrNo.Text;
                DataTable DsGrdetail = obj.selectGrDetails("SelectGRDetail", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFromDiv.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateToDiv.Text)), StrGrno, ApplicationFunction.ConnectionString(), iToCityIdno);
                if ((DsGrdetail != null) && (DsGrdetail.Rows.Count > 0))
                {
                    grdGrdetals.DataSource = DsGrdetail;
                    grdGrdetals.DataBind();
                    lnkbtnSubmitok.Visible = true; btnbtnClear.Visible = true;
                }
                else
                {
                    grdGrdetals.DataSource = null;
                    grdGrdetals.DataBind();
                    lnkbtnSubmitok.Visible = false; btnbtnClear.Visible = false;
                }

                ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
Ejemplo n.º 6
0
 protected void lnkbtnSubmitok_OnClick(object sender, EventArgs e)
 {
     try
     {
         Int32 iRateType = 0; double dcommssn = 0, dweight = 0, dqty = 0, dtotcommssn = 0;
         if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0))
         {
             string strchkValue = string.Empty; string sAllItemIdnos = string.Empty;
             string strchkDetlValue = string.Empty; Int32 Count = 0;
             for (int count = 0; count < grdGrdetals.Rows.Count; count++)
             {
                 CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId");
                 if ((ChkGr != null) && (ChkGr.Checked == true))
                 {
                     HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno");
                     strchkDetlValue = strchkDetlValue + hidGrIdno.Value + ",";
                     Count           = Count + 1;
                 }
             }
             if (strchkDetlValue != "")
             {
                 strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1);
             }
             if (strchkDetlValue == "")
             {
                 ShowMessageErr("Please select atleast one Gr.");
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                 return;
             }
             if (Count > 1)
             {
                 ShowMessageErr("Please select only one Gr. at a time");
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                 return;
             }
             else
             {
                 FreightMemoDAL ObjFreightMemoDAL = new FreightMemoDAL();
                 string         strSbillNo = String.Empty;
                 DataTable      dtRcptDetl = new DataTable(); DataRow Dr;
                 dtRcptDetl      = ObjFreightMemoDAL.SelectGRDetailInRcpt(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddldateRange.SelectedValue), Convert.ToString(strchkDetlValue));
                 ViewState["dt"] = dtRcptDetl;
                 BindValues(dtRcptDetl);
                 grdGrdetals.DataSource = null;
                 grdGrdetals.DataBind();
             }
         }
         else
         {
             ShowMessageErr("Gr Details not found.");
             ShowDiv("ShowBillAgainst('dvGrdetails')");
         }
     }
     catch (Exception Ex)
     {
         ApplicationFunction.ErrorLog(Ex.Message);
     }
 }
Ejemplo n.º 7
0
        protected void lnkbtnsubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0))
                {
                    string strchkValue = string.Empty; string sAllItemIdnos = string.Empty;
                    string strchkDetlValue = string.Empty;
                    for (int count = 0; count < grdGrdetals.Rows.Count; count++)
                    {
                        CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId");
                        if ((ChkGr != null) && (ChkGr.Checked == true))
                        {
                            HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno");
                            strchkDetlValue = strchkDetlValue + hidGrIdno.Value + ",";
                        }
                    }

                    if (strchkDetlValue != "")
                    {
                        strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1);
                    }
                    if (strchkDetlValue == "")
                    {
                        ShowMessageErr("Please check atleast one Gr.");
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                    }
                    else
                    {
                        RcvdAmntAgnstGRDAL obj        = new RcvdAmntAgnstGRDAL();
                        string             strSbillNo = String.Empty;

                        DataTable dtRcptDetl = new DataTable(); DataRow Dr;
                        dtRcptDetl      = obj.SelectGRDetail(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddldateRange.SelectedValue), Convert.ToString(strchkDetlValue));
                        ViewState["dt"] = dtRcptDetl;
                        BindGrid();
                        grdGrdetals.DataSource = null;
                        grdGrdetals.DataBind();
                    }
                    ddlRcptTyp.Focus();
                }
                else
                {
                    ShowMessageErr("Gr Details not found.");
                    grdMain.DataSource = null;
                    grdMain.DataBind();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                }
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
Ejemplo n.º 8
0
        protected void lnkbtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                ClaimFrmDAL objClaimFrmDAL = new ClaimFrmDAL();
                if ((grdSearchRecords != null) && (grdSearchRecords.Rows.Count > 0))
                {
                    string SerialIdDetlValue = string.Empty;
                    for (int count = 0; count < grdSearchRecords.Rows.Count; count++)
                    {
                        CheckBox ChkGr = (CheckBox)grdSearchRecords.Rows[count].FindControl("chkId");
                        if ((ChkGr != null) && (ChkGr.Checked == true))
                        {
                            HiddenField hidSerialIdno = (HiddenField)grdSearchRecords.Rows[count].FindControl("hidSerialIdno");
                            SerialIdDetlValue = SerialIdDetlValue + hidSerialIdno.Value + ",";
                        }
                    }
                    if (SerialIdDetlValue != "")
                    {
                        SerialIdDetlValue = SerialIdDetlValue.Substring(0, SerialIdDetlValue.Length - 1);
                    }
                    if (SerialIdDetlValue == "")
                    {
                        ShowMessageErr("Please select atleast one Serial No.");
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openGridDetail();", true);
                    }
                    else
                    {
                        string Result = String.Empty;

                        DataTable dt = new DataTable(); DataRow Dr;
                        if (RDbSaleBill.Checked == true)
                        {
                            dt = objClaimFrmDAL.Select(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(SerialIdDetlValue));
                        }
                        else
                        {
                            dt = objClaimFrmDAL.SelectClaimDetl(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(SerialIdDetlValue));
                        }
                        if (dt != null && dt.Rows.Count > 0)
                        {
                            objClaimFrmDAL  = null;
                            ViewState["dt"] = dt;
                        }
                        this.BindGridT();
                    }
                }
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
 protected void lnkbtnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         MaterialIssueAgnClaimDAL objMaterialIssueAgnClaimDAL = new MaterialIssueAgnClaimDAL();
         if ((grdSearchRecords != null) && (grdSearchRecords.Rows.Count > 0))
         {
             string CalimIdDetlValue = string.Empty;
             for (int count = 0; count < grdSearchRecords.Rows.Count; count++)
             {
                 CheckBox ChkGr = (CheckBox)grdSearchRecords.Rows[count].FindControl("chkId");
                 if ((ChkGr != null) && (ChkGr.Checked == true))
                 {
                     HiddenField hidHeadIdno = (HiddenField)grdSearchRecords.Rows[count].FindControl("hidHeadIdno");
                     CalimIdDetlValue = CalimIdDetlValue + hidHeadIdno.Value + ",";
                 }
             }
             if (CalimIdDetlValue != "")
             {
                 CalimIdDetlValue = CalimIdDetlValue.Substring(0, CalimIdDetlValue.Length - 1);
             }
             if (CalimIdDetlValue == "")
             {
                 ShowMessageErr("Please select atleast one Claim Number.");
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openGridDetail();", true);
             }
             else
             {
                 var Lst = objMaterialIssueAgnClaimDAL.Select(Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(CalimIdDetlValue));
                 if (Lst != null && Lst.Count > 0)
                 {
                     grdMain.DataSource = Lst;
                     grdMain.DataBind();
                     grdMain.Visible = true;
                 }
             }
         }
     }
     catch (Exception Ex)
     {
         ApplicationFunction.ErrorLog(Ex.Message);
     }
 }
        protected void lnkbtnSubmit_OnClick(object sender, EventArgs e)
        {
            try
            {
                BindDropdownDAL objbind1 = new BindDropdownDAL();
                if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0))
                {
                    string strchkValue = string.Empty; string sAllItemIdnos = string.Empty;
                    string strchkDetlValue = string.Empty;
                    for (int count = 0; count < grdGrdetals.Rows.Count; count++)
                    {
                        CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId");
                        if ((ChkGr != null) && (ChkGr.Checked == true))
                        {
                            HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno");
                            strchkDetlValue = strchkDetlValue + hidGrIdno.Value + ",";
                        }
                    }
                    if (strchkDetlValue != "")
                    {
                        strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1);
                    }
                    if (strchkDetlValue == "")
                    {
                        ShowMessageErr("Please select atleast one Gr.");
                        ShowDiv("ShowClient('dvGrdetails')");
                    }

                    else
                    {
                        LorryHireDAL ObjChlnBookingDAL = new LorryHireDAL();
                        string       strSbillNo        = String.Empty;
                        DataTable    dtRcptDetl        = new DataTable();
                        DataTable    dtKMDetl          = new DataTable();
                        dtRcptDetl      = ObjChlnBookingDAL.SelectGrChallanDetails(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddlDateRange.SelectedValue), Convert.ToString(strchkDetlValue));
                        ViewState["dt"] = dtRcptDetl;
                        BindGrid();
                        grdGrdetals.DataSource = null;
                        grdGrdetals.DataBind();
                        if (grdMain.Rows.Count > 0)
                        {
                            foreach (GridViewRow Dr in grdMain.Rows)
                            {
                                Label lblSubTotAmnt = (Label)Dr.FindControl("lblSubTotAmnt");
                                dGrAmnt += Convert.ToDouble(lblSubTotAmnt.Text);
                            }
                        }
                        txtfreight.Text = Convert.ToString(dGrAmnt);
                        netamntcal();
                    }
                }
                else
                {
                    ShowMessageErr("Gr Details not found.");
                    grdMain.DataSource = null;
                    grdMain.DataBind();
                    //  ddlDelvryPlace.Enabled = true;
                    ShowDiv("ShowBillAgainst('dvGrdetails')");
                }
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
        protected void lnkbtnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                objClaimFrmDAL = new ClaimToDAL();
                if ((grdSearchRecords != null) && (grdSearchRecords.Rows.Count > 0))
                {
                    string ClaimIdDetlValue = string.Empty;
                    for (int count = 0; count < grdSearchRecords.Rows.Count; count++)
                    {
                        CheckBox ChkGr = (CheckBox)grdSearchRecords.Rows[count].FindControl("chkId");
                        if ((ChkGr != null) && (ChkGr.Checked == true))
                        {
                            HiddenField hidClaimIdno = (HiddenField)grdSearchRecords.Rows[count].FindControl("HidClaimIdno");
                            ClaimIdDetlValue = ClaimIdDetlValue + hidClaimIdno.Value + ",";
                        }
                    }
                    if (ClaimIdDetlValue != "")
                    {
                        ClaimIdDetlValue = ClaimIdDetlValue.Substring(0, ClaimIdDetlValue.Length - 1);
                    }
                    if (ClaimIdDetlValue == "")
                    {
                        ShowMessageErr("Please select atleast one Serial No.");
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openGridDetail();", true);
                    }
                    else
                    {
                        objClaimFrmDAL = new ClaimToDAL();
                        if (rdoAgnReceived.Checked)
                        {
                            var Lst = objClaimFrmDAL.SelectClaimDetailsForRecvd(Convert.ToString(ClaimIdDetlValue));
                            if (Lst != null && Lst.Count > 0)
                            {
                                grdMain.DataSource = Lst;
                                grdMain.DataBind();
                                grdMain.Visible = true;
                                if (rdoAgnReceived.Checked)
                                {
                                    grdMain.Columns[9].Visible = grdMain.Columns[10].Visible = true; grdMain.Columns[4].Visible = grdMain.Columns[5].Visible = grdMain.Columns[6].Visible = grdMain.Columns[7].Visible = false;
                                }
                                else
                                {
                                    grdMain.Columns[4].Visible = grdMain.Columns[5].Visible = grdMain.Columns[6].Visible = grdMain.Columns[7].Visible = true; grdMain.Columns[9].Visible = grdMain.Columns[10].Visible = false;
                                }
                            }
                        }
                        else
                        {
                            var Lst = objClaimFrmDAL.Select(Convert.ToString(ClaimIdDetlValue));

                            if (Lst != null && Lst.Count > 0)
                            {
                                grdMain.DataSource = Lst;
                                grdMain.DataBind();
                                grdMain.Visible = true;
                                if (rdoAgnReceived.Checked)
                                {
                                    grdMain.Columns[9].Visible = grdMain.Columns[10].Visible = true; grdMain.Columns[4].Visible = grdMain.Columns[5].Visible = grdMain.Columns[6].Visible = grdMain.Columns[7].Visible = false;
                                }
                                else
                                {
                                    grdMain.Columns[4].Visible = grdMain.Columns[5].Visible = grdMain.Columns[6].Visible = grdMain.Columns[7].Visible = true; grdMain.Columns[9].Visible = grdMain.Columns[10].Visible = false;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
        }
Ejemplo n.º 12
0
 protected void lnkbtnDivSubmit_OnClick(object sender, EventArgs e)
 {
     try
     {
         if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0))
         {
             string strchkValue = string.Empty; string sAllItemIdnos = string.Empty;
             string strchkDetlValue = string.Empty; int Icount = 0;
             for (int count = 0; count < grdGrdetals.Rows.Count; count++)
             {
                 CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId");
                 if ((ChkGr != null) && (ChkGr.Checked == true))
                 {
                     //HiddenField hidChlnIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidChlnIdno");
                     //chlnIdno = Convert.ToInt64(hidChlnIdno.Value);
                     HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno");
                     strchkDetlValue  = strchkDetlValue + hidGrIdno.Value + ",";
                     RcptGoodHeadIdno = Convert.ToInt64(hidGrIdno.Value); HidGrAgnstRcptIdno.Value = (hidGrIdno.Value);
                     Icount++;
                 }
             }
             if (Icount > 1)
             {
                 //ShowMessage("Please check only one Gr.");
                 lblmsg.Visible  = true;
                 lblmsg2.Visible = true;
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                 // ShowDiv("ShowClient('dvGrdetails')");
                 return;
             }
             else
             {
                 lblmsg.Visible  = false;
                 lblmsg2.Visible = false;
             }
             if (strchkDetlValue != "")
             {
                 strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1);
             }
             if (strchkDetlValue == "")
             {
                 lblmsg.Visible  = true;
                 lblmsg2.Visible = true;
                 lblmsg.Text     = "Please select atleast one record.";
                 lblmsg2.Text    = "Please select atleast one record.";
                 ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                 //ShowMessage("Please check atleast one Gr.");
                 // ShowDiv("ShowClient('dvGrdetails')");
                 return;
             }
             else
             {
                 lblmsg.Visible  = false;
                 lblmsg2.Visible = false;
                 SummaryRegisterDAL obj = new SummaryRegisterDAL();
                 string             strSbillNo = String.Empty;
                 DataTable          dtRcptDetl = new DataTable(); DataRow Dr;
                 dtRcptDetl                = obj.selectDetails("SelectChlnDetailInRcpt", Convert.ToString(strchkDetlValue), ApplicationFunction.ConnectionString());
                 ViewState["dt"]           = dtRcptDetl;
                 hidchlnIdno.Value         = Convert.ToString(dtRcptDetl.Rows[0]["Chln_idno"]);
                 ddlFromCity.SelectedValue = Convert.ToString(dtRcptDetl.Rows[0]["ToCity_Idno"]); ddlFromCity.Enabled = false;
                 txtchlnNo.Text            = Convert.ToString(dtRcptDetl.Rows[0]["Chln_No"]); txtchlnNo.Enabled = false;
                 txtCrossing.Text          = Convert.ToString(dtRcptDetl.Rows[0]["CrsngGR_Amnt"]); txtCrossing.Enabled = false;
                 txtfreightCharg.Text      = Convert.ToString(dtRcptDetl.Rows[0]["FreightAmnt"]); txtfreightCharg.Enabled = false;
                 ddltruckno.SelectedValue  = Convert.ToString(dtRcptDetl.Rows[0]["Truck_Idno"]);  // ddltruckno.Enabled = false;
                 ddldriver.SelectedValue   = Convert.ToString(dtRcptDetl.Rows[0]["Driver_Idno"]); //ddldriver.Enabled = false;
                 totalAmntCal1();
                 NetAmntCal();
             }
             chkSelectAllRows.Checked = false;
         }
         else
         {
             //ShowMessageErr("Gr Details not found.");
             //grdMain.DataSource = null;
             //grdMain.DataBind();
             chkSelectAllRows.Checked = false;
             // ddlDelvryPlace.Enabled = true;
             //ShowDiv("ShowBillAgainst('dvGrdetails')");
             ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
         }
     }
     catch (Exception Ex)
     {
         ApplicationFunction.ErrorLog(Ex.Message);
     }
 }
Ejemplo n.º 13
0
        protected void lnkbtnokClick_OnClick(object sender, EventArgs e)
        {
            try
            {
                if ((grdGrdetals != null) && (grdGrdetals.Rows.Count > 0))
                {
                    string strchkValue = string.Empty; string sAllItemIdnos = string.Empty;
                    string strchkDetlValue = string.Empty; int Icount = 0;
                    for (int count = 0; count < grdGrdetals.Rows.Count; count++)
                    {
                        CheckBox ChkGr = (CheckBox)grdGrdetals.Rows[count].FindControl("chkId");
                        if ((ChkGr != null) && (ChkGr.Checked == true))
                        {
                            HiddenField hidGrIdno = (HiddenField)grdGrdetals.Rows[count].FindControl("hidGrIdno");
                            strchkDetlValue = strchkDetlValue + hidGrIdno.Value + ",";
                            Icount++;
                        }
                    }
                    if (Icount > 1)
                    {
                        ////ShowMessage("Please check only one Gr.");
                        //lblmsg.Visible = true;
                        //ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmsg", "ShowClient('dvGrdetails')", true);
                        //// ShowDiv("ShowClient('dvGrdetails')");
                        //return;
                    }
                    else
                    {
                        lblmsg.Visible = true;
                        lblmsg.Text    = "Please select at least one Gr.";
                    }
                    if (strchkDetlValue != "")
                    {
                        strchkDetlValue = strchkDetlValue.Substring(0, strchkDetlValue.Length - 1);
                    }
                    if (strchkDetlValue == "")
                    {
                        lblmsg.Text = "Please select atleast one Gr.";
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                        //ShowMessage("Please check atleast one Gr.");
                        // ShowDiv("ShowClient('dvGrdetails')");
                        return;
                    }
                    else
                    {
                        lblmsg.Visible = false;
                        DeliveryChallanDetailsDAL obj = new DeliveryChallanDetailsDAL();
                        string    strSbillNo          = String.Empty;
                        DataTable dtRcptDetl          = new DataTable();
                        dtRcptDetl      = obj.SelectDELVGrDetails(ApplicationFunction.ConnectionString(), Convert.ToInt32(ddldateRange.SelectedValue), Convert.ToString(strchkDetlValue));
                        ViewState["dt"] = dtRcptDetl;

                        grdMain.DataSource = null;
                        //foreach (GridViewRow row in grdMain.Rows)
                        //{
                        //    ImageButton imgbtndelete = (ImageButton)row.FindControl("imgbtndelete");
                        //    imgbtndelete.Enabled = false;
                        //}
                        grdMain.DataSource = dtRcptDetl;
                        grdMain.DataBind();
                        ddlDelvryPlace.SelectedValue = ddldelvplace.SelectedValue;
                    }
                }
                else
                {
                    ShowMessageErr("Gr Details not found.");
                    grdMain.DataSource = null;
                    grdMain.DataBind();
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop1", "openModal();", true);
                }
                ddlTruckNo.Focus();
            }
            catch (Exception Ex)
            {
                ApplicationFunction.ErrorLog(Ex.Message);
            }
            //ScriptManager.RegisterStartupScript(this, this.GetType(), "alertmsg", "ShowClient('dvGrdetails')", true);
            //ddldelvplace.SelectedIndex = 0;
            //grdGrdetals.DataSource = null;
            //grdGrdetals.DataBind(); btnSubmit.Visible = false; BtnClerForPurOdr.Visible = false;
        }