Example #1
0
        private void LoadData()
        {
            fwLocationEntity oLoc = (fwLocationEntity)fwLocBLL.GetFLoc(Convert.ToInt32(hdnFLocID.Value));

            //ddlFromLocation.SelectedIndex = Convert.ToInt32(ddlFromLocation.Items.IndexOf(ddlFromLocation.Items.FindByValue(oImportHaulage.LocationFrom)));
            //hdnFLineID.Value = oLine.LineID.ToString();
            txtLocation.Text = Convert.ToString(oLoc.LocName);
            txtAbbr.Text     = Convert.ToString(oLoc.Abbreviation);
            txtCity.Text     = Convert.ToString(oLoc.LocAddress.City);
            TxtPin.Text      = Convert.ToString(oLoc.LocAddress.Pin);
            txtAddress.Text  = Convert.ToString(oLoc.LocAddress.Address);
            txtPhone.Text    = Convert.ToString(oLoc.Phone);
        }
Example #2
0
        public static IFwLocation GetFLoc(int ID)
        {
            string      strExecution = "[fwd].[uspGetLocation]";
            IFwLocation oIH          = null;

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@LocId", ID);
                oDq.AddVarcharParam("@SortExpression", 30, "");
                oDq.AddVarcharParam("@SortDirection", 4, "");
                DataTableReader reader = oDq.GetTableReader();

                while (reader.Read())
                {
                    oIH = new fwLocationEntity(reader);
                }
                reader.Close();
            }
            return(oIH);
        }
Example #3
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                //if (Convert.ToDecimal(txtWFrom.Text) > Convert.ToDecimal(txtWTo.Text))
                //{
                //    ScriptManager.RegisterStartupScript(this, typeof(Page), "alert", "<script>javascript:void alert('" + ResourceManager.GetStringWithoutName("ERR00077") + "');</script>", false);
                //    return;
                //}
                string mode;

                oLineBll    = new fwLocBLL();
                oLineEntity = new fwLocationEntity();
                //oUserEntity = (UserEntity)Session[Constants.SESSION_USER_INFO]; // This section has been commented temporarily
                mode = "U";
                if (hdnFLocID.Value.ToInt() == 0)
                {
                    mode = "A";
                }
                oLineEntity.LocName            = txtLocation.Text.ToString();
                oLineEntity.locID              = hdnFLocID.ToInt();
                oLineEntity.LocAddress.Pin     = TxtPin.Text;
                oLineEntity.LocAddress.Address = txtAddress.Text;
                oLineEntity.LocAddress.City    = txtCity.Text;
                oLineEntity.Phone              = txtPhone.Text;
                oLineEntity.Abbreviation       = txtAbbr.Text;
                oLineEntity.CreatedBy          = _userId;

                oLineBll.SaveFwLoc(oLineEntity);
                if (mode == "A")
                {
                    ClearAll();
                }
                else
                {
                    Response.Redirect("~/Forwarding/Master/ManageFLoc.aspx");
                }
            }
        }
Example #4
0
        public static List <IFwLocation> GetfwLoc(SearchCriteria searchCriteria)
        {
            string             strExecution = "[fwd].[uspGetLocation]";
            List <IFwLocation> lstLine      = new List <IFwLocation>();

            using (DbQuery oDq = new DbQuery(strExecution))
            {
                oDq.AddIntegerParam("@LocId", searchCriteria.LocationID);
                oDq.AddVarcharParam("@SchLocName", 100, searchCriteria.LocName);
                oDq.AddVarcharParam("@SchAbbr", 100, searchCriteria.LocAbbr);
                oDq.AddVarcharParam("@SortExpression", 50, searchCriteria.SortExpression);
                oDq.AddVarcharParam("@SortDirection", 4, searchCriteria.SortDirection);
                DataTableReader reader = oDq.GetTableReader();


                while (reader.Read())
                {
                    IFwLocation oLine = new fwLocationEntity(reader);
                    lstLine.Add(oLine);
                }
                reader.Close();
            }
            return(lstLine);
        }