private void TotalReords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString((from CT in db.tblPositionMasts
                                                                     select new
         {
             PositIdno = CT.Position_id,
             PositName = CT.Position_name,
             Status = CT.IsActive,
         }).Count());
     }
 }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         //ShortageRepDAL obj = new ShortageRepDAL();
         //DataTable list1 = obj.SelectRep("SelectRepWithoutParty", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), 0, 0, UserIdno, ApplicationFunction.ConnectionString());
         //lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         outsndngBillRepDAL obj   = new outsndngBillRepDAL();
         DataTable          list1 = obj.SelectRep("SelectRep", Convert.ToString(txtDateFrom.Text), Convert.ToString(txtDateTo.Text), 0, 0, 0, UserIdno, ApplicationFunction.ConnectionString(), Convert.ToString(txtPrefixNo.Text.Trim()));
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
 private Int32 TotRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         Int32 Count = db.MatIssHeads.Count();
         if (Count > 0)
         {
             return(Count);
         }
         else
         {
             return(0);
         }
     }
 }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         TyreMoveRpt obj   = new TyreMoveRpt();
         Int64       list1 = obj.TotalRecords(Convert.ToDateTime(ApplicationFunction.mmddyyyy(Datefrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(Dateto.Text)), Convert.ToInt32(ddlDateRange.SelectedIndex), 0, "");
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1);
     }
 }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         TyreStockRpt obj      = new TyreStockRpt();
         Int32        yearidno = Convert.ToInt32(ddlDateRange.SelectedIndex);
         DataTable    list1    = obj.SelectTyreStockReport(ApplicationFunction.ConnectionString(), Datefrom.Text.Trim(), Dateto.Text.Trim(), 0, Convert.ToInt64(0), 0, Convert.ToInt64(ddlLocation.SelectedValue));
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
Esempio n. 7
0
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         CurrentStockRpt obj    = new CurrentStockRpt();
         Int64           YearId = Convert.ToInt64(ddlDateRange.SelectedValue);
         DataTable       list1  = obj.SelectCurrentStockReport(ApplicationFunction.ConnectionString(), Convert.ToDateTime(hidmindate.Value), 0, "", 0, YearId);
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         InvoiceRepOTHDAL obj     = new InvoiceRepOTHDAL();
         Int64            iInvTyp = (Convert.ToString(ddlInvType.SelectedValue) == "" ? 0 : Convert.ToInt64(ddlInvType.SelectedValue));
         DataTable        list1   = obj.SelectRep("SelectInvwiseRep", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), String.Empty, 0, 0, 0, UserIdno, iInvTyp, ApplicationFunction.ConnectionString());
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
Esempio n. 9
0
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         Int32  iPanNoIDNO = (Convert.ToString(ddlPanNo.SelectedValue) == "" ? 0 : Convert.ToInt32(ddlPanNo.SelectedValue));
         string UserClass  = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno   = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         LorryMasterRepDAL obj   = new LorryMasterRepDAL();
         DataTable         list1 = obj.SelectForSearch(-1, "", 0, 0, txtPanNumber.Text.Trim(), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), conString);
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
        private void BindPartyName()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                List <AcntMast> lst = null;
                lst = (from cm in db.AcntMasts where cm.Acnt_Type == 2 || cm.Acnt_Type == 5 || cm.Acnt_Type == 6 orderby cm.Acnt_Name ascending select cm).ToList();


                var SenderName = lst;
                ddlParty.DataSource     = SenderName;
                ddlParty.DataTextField  = "Acnt_Name";
                ddlParty.DataValueField = "Acnt_Idno";
                ddlParty.DataBind();

                ddlParty.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));
            }
        }
Esempio n. 11
0
        private void TotalRecords()
        {
            using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
            {
                Int32  iyearidno = (Convert.ToString(ddlDateRange.SelectedValue) == "" ? 0 : Convert.ToInt32(ddlDateRange.SelectedValue));
                string UserClass = Convert.ToString(Session["Userclass"]);
                Int64  UserIdno  = 0;
                if (UserClass != "Admin")
                {
                    UserIdno = Convert.ToInt64(Session["UserIdno"]);
                }

                PendGrForInvDAL obj   = new PendGrForInvDAL();
                DataTable       list1 = obj.selectGrDetails("SelectGRWithoutChallan", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), 0, 0, iyearidno, UserIdno, 0, ApplicationFunction.ConnectionString());
                lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
            }
        }
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         Int64          iFromCityIDNO = (drpBaseCity.SelectedIndex <= 0 ? 0 : Convert.ToInt64(drpBaseCity.SelectedValue));
         DispatchRegDAL obj           = new DispatchRegDAL();
         DataTable      list1         = obj.SelectRep("SelectRep", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)),
                                                      iFromCityIDNO, Convert.ToInt64(ddllorrytype.SelectedValue), Convert.ToInt64(ddlDestination.SelectedValue), conString);
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
Esempio n. 13
0
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         Int64 iFromCityIDNO        = (Convert.ToString(drpBaseCity.SelectedValue) == "" ? 0 : Convert.ToInt64(drpBaseCity.SelectedValue));
         Int64 iTruckIDNO           = (Convert.ToString(ddlTruckNo.SelectedValue) == "" ? 0 : Convert.ToInt64(ddlTruckNo.SelectedValue));
         Int32 ichlnType            = (Convert.ToString(ddlChlnType.SelectedValue) == "" ? 0 : Convert.ToInt32(ddlChlnType.SelectedValue));
         ChlnConfirmationRepDAL obj = new ChlnConfirmationRepDAL();
         DataTable list1            = obj.SelectRep(Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), iFromCityIDNO, iTruckIDNO, ichlnType, UserIdno, conString);
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
Esempio n. 14
0
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
         string UserClass = Convert.ToString(Session["Userclass"]);
         Int64  UserIdno  = 0;
         if (UserClass != "Admin")
         {
             UserIdno = Convert.ToInt64(Session["UserIdno"]);
         }
         Int64            iFromCityIDNO = (drpBaseCity.SelectedIndex <= 0 ? 0 : Convert.ToInt64(drpBaseCity.SelectedValue));
         Int64            iSenderIDNO   = (ddlSender.SelectedIndex <= 0 ? 0 : Convert.ToInt64(ddlSender.SelectedValue));
         Int64            GrNO          = string.IsNullOrEmpty(txtGrNo.Text.Trim()) ? 0 : Convert.ToInt64(txtGrNo.Text.Trim());
         GRRetailerRepDAL obj           = new GRRetailerRepDAL();
         DataTable        list1         = obj.SelectRep("SelectRep", Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateFrom.Text)), Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDateTo.Text)), iFromCityIDNO,
                                                        iSenderIDNO, GrNO, conString);
         lblTotalRecord.Text = "T. Record (s): " + Convert.ToString(list1.Rows.Count);
     }
 }
Esempio n. 15
0
 private void TotalRecords()
 {
     using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
     {
     }
 }
        protected void lnkbtnSave_OnClick(object sender, EventArgs e)
        {
            #region Validation Messages for Challan Details

            if (ddlTranspoter.SelectedIndex == 0)
            {
                this.ShowMessage("Please select Transporter."); ddlTranspoter.Focus(); return;
            }
            if (ddlTruckNo.SelectedIndex == 0)
            {
                this.ShowMessage("Please select Truck No."); ddlTruckNo.Focus(); return;
            }
            if (txtchlnRef.Text == "")
            {
                this.ShowMessage("Please Enter Challan Ref.No ."); ddlTruckNo.Focus(); return;
            }

            string msg = "";
            dtTemp = (DataTable)ViewState["dt"];
            if (dtTemp != null)
            {
                if (dtTemp.Rows.Count <= 0)
                {
                    ShowMessage("Please enter details");
                    return;
                }
            }
            if (grdMain.Rows.Count <= 0)
            {
                ShowMessage("Please enter details");
                return;
            }

            #endregion

            #region Declare Input Variables for Challan Details
            //string strMsg = string.Empty;
            //Int64 intGrPrepIdno = 0;
            //Int32 YearIdno = Convert.ToInt32(ddldateRange.SelectedValue) == -1 ? 0 : Convert.ToInt32(ddldateRange.SelectedValue);
            //DateTime strChallanDate = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDate.Text.Trim().ToString()));
            //Int64 intChallanNo = string.IsNullOrEmpty(txtchallanNo.Text.Trim()) ? 0 : Convert.ToInt64(txtchallanNo.Text.Trim());
            //Int32 intTranspoter = string.IsNullOrEmpty(ddlTranspoter.SelectedValue) ? 0 : Convert.ToInt32(ddlTranspoter.SelectedValue);
            //Int32 TruckNoIdno = string.IsNullOrEmpty(ddlTruckNo.SelectedValue) ? 0 : Convert.ToInt32(ddlTruckNo.SelectedValue);
            //Int32 strChlnRefno = string.IsNullOrEmpty(txtchlnRef.Text) ? 0 : Convert.ToInt32(txtchlnRef.Text);

            //DateTime? dtInstDate;
            //if (txtInstDate.Text == "")
            //{
            //    dtInstDate = null;

            //}
            //else
            //{
            //    dtInstDate = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtInstDate.Text));
            //}

            #endregion

            #region Insert/Update with Transaction
            using (TransactionScope tScope = new TransactionScope(TransactionScopeOption.Required))
            {
                string    intGrPrepIdno = "";
                string    ChlnNo        = txtchallanNo.Text;
                Int32     TrunckIdno    = Convert.ToInt32(ddlTruckNo.SelectedValue);
                Int32     YearIdno      = Convert.ToInt32((ddldateRange.SelectedIndex < 0) ? "0" : ddldateRange.SelectedValue);
                GRPrepDAL objDAL        = new GRPrepDAL();
                isTBBRate = objDAL.SelectTBBRate();
                tblUserPref userpref = objDAL.selectuserpref();
                itruckcitywise = Convert.ToInt32(userpref.Work_Type);

                DataTable dtDetail = (DataTable)ViewState["dt"];
                try
                {
                    ChlnBookingCrsngDAL obj = new ChlnBookingCrsngDAL();
                    tblChlnBookHead     objtblChlnBookHead = new tblChlnBookHead();
                    objtblChlnBookHead.Chln_No        = txtchallanNo.Text;
                    objtblChlnBookHead.Chln_Date      = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDate.Text));
                    objtblChlnBookHead.BaseCity_Idno  = Convert.ToInt32((DdlfromcityHead.SelectedIndex <= 0) ? "0" : DdlfromcityHead.SelectedValue);
                    objtblChlnBookHead.DelvryPlc_Idno = Convert.ToInt32(0);
                    objtblChlnBookHead.Truck_Idno     = Convert.ToInt32((ddlTruckNo.SelectedIndex <= 0) ? "0" : ddlTruckNo.SelectedValue);
                    objtblChlnBookHead.Year_Idno      = Convert.ToInt32((ddldateRange.SelectedIndex < 0) ? "0" : ddldateRange.SelectedValue);

                    objtblChlnBookHead.Driver_Idno   = Convert.ToInt32(1);
                    objtblChlnBookHead.Delvry_Instrc = "";

                    objtblChlnBookHead.Inv_Idno       = 0;
                    objtblChlnBookHead.Gross_Amnt     = Convert.ToDouble(txtgrossAmnt.Text);
                    objtblChlnBookHead.Commsn_Amnt    = Convert.ToDouble(0.00);
                    objtblChlnBookHead.Transprtr_Idno = Convert.ToInt32(ddlTranspoter.SelectedValue);
                    objtblChlnBookHead.Chln_type      = 2;
                    objtblChlnBookHead.Net_Amnt       = Convert.ToDouble(txtNetAmnt.Text);
                    objtblChlnBookHead.Other_Amnt     = Convert.ToDouble(txtKattAmnt.Text);
                    objtblChlnBookHead.Work_type      = Convert.ToInt32(hidWorkType.Value);
                    objtblChlnBookHead.Ref_No         = Convert.ToString(txtchlnRef.Text);
                    objtblChlnBookHead.Adv_Amnt       = Convert.ToDouble(0.00);
                    objtblChlnBookHead.RcptType_Idno  = Convert.ToInt32(1);
                    objtblChlnBookHead.Bank_Idno      = Convert.ToInt32(0);
                    objtblChlnBookHead.Inst_No        = Convert.ToInt32(0);
                    objtblChlnBookHead.Inst_Dt        = Convert.ToDateTime(ApplicationFunction.mmddyyyy(txtDate.Text));
                    objtblChlnBookHead.Date_Added     = Convert.ToDateTime(DateTime.Now);
                    Int64 value = 0;
                    if (string.IsNullOrEmpty(hidid.Value) == true)
                    {
                        if (grdMain.Rows.Count > 0 && dtTemp != null && dtTemp.Rows.Count > 0)
                        {
                            ChlnBookingCrsngDAL obj1 = new ChlnBookingCrsngDAL();
                            intGrPrepIdno = obj1.InsertGR(ChlnNo, TrunckIdno, YearIdno, isTBBRate, itruckcitywise, dtDetail);
                            obj1          = null;
                        }
                        value = obj.Insert(objtblChlnBookHead, dtTemp, intGrPrepIdno);
                        // obj = null;
                    }
                    else
                    {
                        using (TransportMandiEntities db = new TransportMandiEntities(MultipleDBDAL.strDynamicConString()))
                        {
                            db.Connection.Open();
                            Int32            ChlnIdno = Convert.ToInt32(hidid.Value);
                            TblGrHead        GrHEad   = db.TblGrHeads.Where(rd => rd.Chln_Idno == ChlnIdno).FirstOrDefault();
                            List <TblGrDetl> GrDetl   = db.TblGrDetls.Where(rd => rd.GrHead_Idno == GrHEad.GR_Idno).ToList();
                            foreach (TblGrDetl rgd in GrDetl)
                            {
                                db.TblGrDetls.DeleteObject(rgd);
                                db.SaveChanges();
                            }

                            db.TblGrHeads.DeleteObject(GrHEad);
                            db.SaveChanges();
                            db.Connection.Close();
                        }

                        if (grdMain.Rows.Count > 0 && dtTemp != null && dtTemp.Rows.Count > 0)
                        {
                            ChlnBookingCrsngDAL obj1 = new ChlnBookingCrsngDAL();
                            intGrPrepIdno = obj1.InsertGR(ChlnNo, TrunckIdno, YearIdno, isTBBRate, itruckcitywise, dtDetail);
                            obj1          = null;
                        }

                        value = obj.Update(objtblChlnBookHead, Convert.ToInt32(hidid.Value), dtTemp, intGrPrepIdno);
                    }
                    if (value > 0)
                    {
                        tScope.Complete();
                    }

                    if (value > 0 && (string.IsNullOrEmpty(hidid.Value) == false))
                    {
                        ShowMessage("Record Update successfully");
                        Response.Redirect("ChlnBookingCrsng.aspx", false);
                    }
                    else if (value == -1)
                    {
                        ShowMessage("Challan No Already Exist");
                    }
                    else
                    {
                        ShowMessage("Record  Not Update");
                    }
                    if (value > 0 && (string.IsNullOrEmpty(hidid.Value) == true))
                    {
                        ShowMessage("Record  saved Successfully ");
                        Response.Redirect("ChlnBookingCrsng.aspx", false);
                    }
                    else if (value == -1)
                    {
                        tScope.Dispose();
                        ShowMessage("Challan No Already Exist");
                    }
                    else
                    {
                        ShowMessage("Record Not saved Successfully ");
                    }
                }
                catch (Exception Ex)
                {
                    tScope.Dispose();
                }

                #endregion
            }
        }