Example #1
0
        private void BindSenderReceiverAgentPopulate()
        {
            ReceiptGoodsReceivedDAL obj    = new ReceiptGoodsReceivedDAL();
            var             SenderReceiver = obj.SelectAcntMastByTypePopulate(2);
            BindDropdownDAL objagent       = new BindDropdownDAL();
            var             Agent          = objagent.BindAgent();

            obj = null;
            drpSender.DataSource     = SenderReceiver;
            drpSender.DataTextField  = "Acnt_Name";
            drpSender.DataValueField = "Acnt_Idno";
            drpSender.DataBind();
            drpSender.Items.Insert(0, new ListItem("--Select--", "0"));

            drpReceiver.DataSource     = SenderReceiver;
            drpReceiver.DataTextField  = "Acnt_Name";
            drpReceiver.DataValueField = "Acnt_Idno";
            drpReceiver.DataBind();
            drpReceiver.Items.Insert(0, new ListItem("--Select--", "0"));

            drpAgentName.DataSource     = Agent;
            drpAgentName.DataTextField  = "Acnt_Name";
            drpAgentName.DataValueField = "Acnt_Idno";
            drpAgentName.DataBind();
            drpAgentName.Items.Insert(0, new ListItem("--Select--", "0"));
        }
        private void BindDropdown()
        {
            BindDropdownDAL obj         = new BindDropdownDAL();
            var             senderLst   = obj.BindSender();
            var             receiverLst = obj.BindSender();
            var             TruckNolst  = obj.BindTruckNo();
            var             ToCity      = obj.BindAllToCity();
            var             Agent       = obj.BindAgent();
            var             bank        = obj.BindBank();
            var             itemname    = obj.BindItemName();
            var             UnitName    = obj.BindUnitName();
            var             Transpoter  = obj.BindTranspoter();

            obj = null;

            ddlSenderName.DataSource     = senderLst;
            ddlSenderName.DataTextField  = "Acnt_Name";
            ddlSenderName.DataValueField = "Acnt_Idno";
            ddlSenderName.DataBind();
            ddlSenderName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlReciverName.DataSource     = receiverLst;
            ddlReciverName.DataTextField  = "acnt_name";
            ddlReciverName.DataValueField = "acnt_idno";
            ddlReciverName.DataBind();
            ddlReciverName.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlTruckNo.DataSource     = TruckNolst;
            ddlTruckNo.DataTextField  = "Lorry_No";
            ddlTruckNo.DataValueField = "lorry_idno";
            ddlTruckNo.DataBind();
            ddlTruckNo.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddltoCity.DataSource     = ToCity;
            ddltoCity.DataTextField  = "city_name";
            ddltoCity.DataValueField = "city_idno";
            ddltoCity.DataBind();
            ddltoCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlfromCity.DataSource     = ToCity;
            ddlfromCity.DataTextField  = "city_name";
            ddlfromCity.DataValueField = "city_idno";
            ddlfromCity.DataBind();
            ddlfromCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlTranspoter.DataSource     = Transpoter;
            ddlTranspoter.DataTextField  = "Acnt_Name";
            ddlTranspoter.DataValueField = "Acnt_Idno";
            ddlTranspoter.DataBind();
            ddlTranspoter.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));
        }
Example #3
0
        private void BindDropdown()
        {
            BindDropdownDAL obj         = new BindDropdownDAL();
            var             senderLst   = obj.BindSender();
            var             receiverLst = obj.BindSender();
            var             TruckNolst  = obj.BindTruckNowithLastDigit();
            var             ToCity      = obj.BindAllToCity();
            var             Agent       = obj.BindAgent();
            var             bank        = obj.BindBank();
            var             UnitName    = obj.BindUnitName();
            var             ToCityComp  = obj.BindLocFrom();

            obj = null;

            ddlSender.DataSource     = senderLst;
            ddlSender.DataTextField  = "Acnt_Name";
            ddlSender.DataValueField = "Acnt_Idno";
            ddlSender.DataBind();
            ddlSender.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlTruckNo.DataSource     = TruckNolst;
            ddlTruckNo.DataTextField  = "Lorry_No";
            ddlTruckNo.DataValueField = "Lorry_Idno";
            ddlTruckNo.DataBind();
            ddlTruckNo.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlFromCity.DataSource     = ToCity;
            ddlFromCity.DataTextField  = "city_name";
            ddlFromCity.DataValueField = "city_idno";
            ddlFromCity.DataBind();
            ddlFromCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlToCity.DataSource     = ToCity;
            ddlToCity.DataTextField  = "city_name";
            ddlToCity.DataValueField = "city_idno";
            ddlToCity.DataBind();
            ddlToCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlCompFromCity.DataSource     = ToCity;
            ddlCompFromCity.DataTextField  = "city_name";
            ddlCompFromCity.DataValueField = "city_idno";
            ddlCompFromCity.DataBind();
            ddlCompFromCity.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--Select--", "0"));

            ddlCompFromCity.DataSource     = ToCityComp;
            ddlCompFromCity.DataTextField  = "City_Name";
            ddlCompFromCity.DataValueField = "City_Idno";
            ddlCompFromCity.DataBind();
            ddlCompFromCity.Items.Insert(0, new ListItem("--Select--", "0"));
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.UrlReferrer == null)
            {
                base.AutoRedirect();
            }
            if (!Page.IsPostBack)
            {
                if (base.CheckUserRights(intFormId) == false)
                {
                    Response.Redirect("PermissionDenied.aspx");
                }
                if (base.ADD == false)
                {
                    lnkbtnSave.Visible = false;
                }
                if (base.View == false)
                {
                    lblViewList.Visible = false;
                }
                txtReceiptDate.Text = DateTime.Now.ToString("dd-MM-yyyy");
                this.GetAllItems();
                this.BindCity();

                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    ReceiptGoodsReceivedDAL obj1 = new ReceiptGoodsReceivedDAL();
                    var lst = obj1.SelectCityCombo();
                    obj1 = null;
                    drpBaseCity.DataSource     = lst;
                    drpBaseCity.DataTextField  = "City_Name";
                    drpBaseCity.DataValueField = "City_Idno";
                    drpBaseCity.DataBind();
                    drpBaseCity.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.BindCity(Convert.ToInt64(Session["UserIdno"]));
                }
                ReceiptGoodsReceivedDAL objChlnBookingDAL = new ReceiptGoodsReceivedDAL();
                tblUserPref             obj = objChlnBookingDAL.selectUserPref();
                if (obj != null)
                {
                    drpBaseCity.SelectedValue = Convert.ToString(obj.BaseCity_Idno);
                }
                drpBaseCity.SelectedValue = Convert.ToString(base.UserFromCity);
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    ReceiptGoodsReceivedDAL obja   = new ReceiptGoodsReceivedDAL();
                    var             SenderReceiver = obja.SelectAcntMastByType(2);
                    BindDropdownDAL objagent       = new BindDropdownDAL();
                    var             Agent          = objagent.BindAgent();
                    obj = null;
                    drpSender.DataSource     = SenderReceiver;
                    drpSender.DataTextField  = "Acnt_Name";
                    drpSender.DataValueField = "Acnt_Idno";
                    drpSender.DataBind();
                    drpSender.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.BindSenderReceiverAgent();
                }
                drpSender.SelectedValue = Convert.ToString(base.Sender);
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    ItemMasterDAL obja = new ItemMasterDAL();
                    var           lst  = obja.GetItems();
                    obj = null;
                    drpItemName.DataSource     = lst;
                    drpItemName.DataTextField  = "ItemName";
                    drpItemName.DataValueField = "ItemId";
                    drpItemName.DataBind();
                    drpItemName.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.GetAllItems();
                }
                drpItemName.SelectedValue = Convert.ToString(base.ItemName);
                if (Convert.ToString(Session["Userclass"]) == "Admin")
                {
                    UOMMasterDAL obja = new UOMMasterDAL();
                    var          lst  = obja.GetUnit();
                    obj = null;
                    drpUnitName.DataSource     = lst;
                    drpUnitName.DataTextField  = "UOMName";
                    drpUnitName.DataValueField = "UOMId";
                    drpUnitName.DataBind();
                    drpUnitName.Items.Insert(0, new ListItem("--Select--", "0"));
                }
                else
                {
                    this.GetAllUnit();
                }
                drpUnitName.SelectedValue = Convert.ToString(base.Unit);
                //this.GetAllUnit();
                this.BindDateRange();
                ddlDateRange_SelectedIndexChanged(null, null);
                ddlDateRange.SelectedIndex = 0;
                drpBaseCity.Enabled        = true;
                this.GetReceiptNo();
                if (Request.QueryString["q"] != null)
                {
                    this.BindSenderReceiverAgentPopulate();
                    Populate(Convert.ToInt64(Request.QueryString["q"]));
                    hidgoodsreceivedid.Value = Convert.ToString(Request.QueryString["q"]);
                    btnNew.Visible           = true;
                    lnkbtnNew.Visible        = true;
                    ddlDateRange.Enabled     = false; imgPrint.Visible = true;
                }

                else
                {
                    lnkbtnNew.Visible    = false;
                    ddlDateRange.Enabled = true;
                    imgPrint.Visible     = false;
                    //this.BindSenderReceiverAgent();
                }

                txtWeight.Attributes.Add("onkeypress", "return allowOnlyFloatNumber(event);");
                txtQty.Attributes.Add("onkeypress", "return allowOnlyNumber(event);");
                txtSenderNo.Attributes.Add("onkeypress", "return allowOnlyNumber(event);");
                txtReceiptDate.Attributes.Add("onkeypress", "return notAllowAnything(event);");
                txtRemark.Attributes.Add("onkeypress", "return notAllowSpecialCharacters_Spaceallow(event);");
            }
            Int32 intYearIdno = Convert.ToInt32(ddlDateRange.SelectedValue);
        }