protected void btnDelete_Command(object sender, CommandEventArgs e)
 {
     try
     {
         string id = Convert.ToString(e.CommandArgument);
         if (!string.IsNullOrEmpty(id))
         {
             CountryBLL countryBLL = new CountryBLL();
             Countries  country    = new Countries();
             country.CountryId = Convert.ToInt32(QuaintSecurityManager.Decrypt(id));
             if (country.CountryId > 0)
             {
                 if (countryBLL.Delete(country))
                 {
                     Alert(AlertType.Success, "Deleted successfully.");
                     LoadList();
                 }
                 else
                 {
                     Alert(AlertType.Error, "Failed to delete.");
                 }
             }
         }
     }
     catch (Exception)
     {
         Alert(AlertType.Error, "Failed to delete.");
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Permissions.ComRedirect(Page, Permissions.redirUrl);
     Response.Cache.SetExpires(DateTime.Now);
     Permissions.CheckManagePermission(EnumCompanyPermission.StorageAddReWareHouse);
     if (!Common.WPermission(Session["Company"].ToString()))
     {
         visdiv.Visible = false;
         Response.Write(Common.ReturnAlert("该管理员没有仓库权限!!"));
         return;
     }
     visdiv.Visible = true;
     if (!IsPostBack)
     {
         CountryModel mode   = CountryBLL.GetCountryModels()[0];
         DataView     dataev = new DataView(BillOutOrderBLL.GetWareHouseName());
         dataev.RowFilter         = "[CountryCode]=" + CountryBLL.GetCountryByCode(mode.ID);
         ddlcangku.DataSource     = dataev;
         ddlcangku.DataTextField  = "WareHouseName";
         ddlcangku.DataValueField = "WareHouseID";
         ddlcangku.DataBind();
         if (string.IsNullOrEmpty(ddlcangku.SelectedValue))
         {
             ViewState["Ekuc"] = "false";
         }
         else
         {
             ViewState["Ekuc"] = "true";
         }
         ddlcangku_SelectedIndexChanged(null, null);
         BtnConfirm_Click(null, null);
     }
     Translations();
 }
Ejemplo n.º 3
0
    public int DALCountryUpdate(CountryBLL ct)
    {
        using (SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]))
        {
            try
            {
                SqlParameter[] par = new SqlParameter[3];
                par[0]           = new SqlParameter("@countryId", ct.countryId);
                par[1]           = new SqlParameter("@countryName", ct.countryName);
                par[2]           = new SqlParameter("@status", 11);
                par[2].Direction = ParameterDirection.Output;

                SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "spCountryUpdate", par);

                status = (int)par[2].Value;
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            finally
            {
                con.Close();
            }
        }
        return(status);
    }
        public ActionResult AddEditCountry(int id = 0, int pid = 0)
        {
            CustomMethods.ValidateRoles("Country");
            if (!Convert.ToBoolean(Session["IsAdd"]) && !Convert.ToBoolean(Session["IsEdit"]))
            {
                return(View("ErrorPage", "Error"));
            }
            CountryModel CountryModel = new CountryModel();
            int          take         = 10;
            int          skip         = take * pid;

            CountryModel.PageID  = pid;
            CountryModel.Current = pid + 1;
            ViewBag.c            = CountryModel.PageID;
            if (id != 0)
            {
                var objcountry = new CountryBLL {
                }.GetCountryById(id);
                if (objcountry != null)
                {
                    CountryModel.CountryId   = objcountry.CountryId;
                    CountryModel.CountryName = objcountry.CountryName;
                    CountryModel.CountryCode = objcountry.CountryCode;
                    CountryModel.IsActive    = Convert.ToBoolean(objcountry.IsActive);
                }
            }
            return(View(CountryModel));
        }
Ejemplo n.º 5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        Response.Cache.SetExpires(DateTime.Now);
        Permissions.CheckManagePermission(EnumCompanyPermission.LogisticsBillOutOrder);

        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));

        if (!IsPostBack)
        {
            AddOrderBLL.BindCurrency_Rate(Dropdownlist2);
            Dropdownlist2.SelectedValue = CountryBLL.GetCurrency();

            ViewState["GridViewID"] = "GridView_BillOutOrder";

            this.DropCurrery.DataSource     = CountryBLL.GetCountryModels();
            this.DropCurrery.DataTextField  = "name";
            this.DropCurrery.DataValueField = "id";
            this.DropCurrery.DataBind();

            btn_Submit_Click(null, null);

            SetFanY();

            DropDownList_Items_SelectedIndexChanged(null, null);
        }
    }
        /// <summary>
        /// Date Created:   27/12/2011
        /// Created By:     Josephine Gad
        /// (description)   Bind Country
        /// </summary>
        private void BindCountry()
        {
            DataTable dt = null;

            try
            {
                dt = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, "");
                uoDropDownListCountry.Items.Clear();
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("--SELECT COUNTRY--", "0"));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (dt != null)
                {
                    dt.Dispose();
                }
            }
        }
        /// <summary>
        /// Date Created:   28/09/2011
        /// Created By:     Josephine Gad
        /// (description)   Get country by region id
        /// ---------------------------------------------------------------------------
        /// </summary>
        private void BindCountry()
        {
            DataTable CountryDataTable = null;

            try
            {
                CountryDataTable = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, "");  //uoTextBoxCountryName.Text
                uoDropDownListCountry.Items.Clear();
                ListItem item = new ListItem("--SELECT COUNTRY--", "0");
                uoDropDownListCountry.Items.Add(item);
                uoDropDownListCountry.DataSource     = CountryDataTable;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();

                if (GlobalCode.Field2String(Session["Country"]) != "")
                {
                    if (uoDropDownListCountry.Items.FindByValue(GlobalCode.Field2String(Session["Country"])) != null)
                    {
                        uoDropDownListCountry.SelectedValue = GlobalCode.Field2String(Session["Country"]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (CountryDataTable != null)
                {
                    CountryDataTable.Dispose();
                }
            }
        }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        if (!IsPostBack)
        {
            Response.Cache.SetExpires(DateTime.Now);
            Permissions.CheckManagePermission(EnumCompanyPermission.LogisticsBrowseStoreOrders);

            this.DropCurrency.DataSource     = CountryBLL.GetCountryModels();
            this.DropCurrency.DataTextField  = "name";
            this.DropCurrency.DataValueField = "id";
            this.DropCurrency.DataBind();

            listCondition();

            if (Request.QueryString["type"] != null)
            {
                type = 1;
            }
            getbtCon();
        }

        SetFanY();

        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
    }
Ejemplo n.º 9
0
        public ActionResult Delete(int id)
        {
            CountryBLL objCountryBLL = new CountryBLL();
            var        country       = objCountryBLL.GetCountry(id);

            return(View(country));
        }
Ejemplo n.º 10
0
    private void Page_Load(object sender, System.EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        this.Btn_Detail.Click += new System.EventHandler(this.Btn_Detail_Click);

        if (!IsPostBack)
        {
            Response.Cache.SetExpires(DateTime.Now);
            Permissions.CheckManagePermission(EnumCompanyPermission.ReportOrderDetail);

            DateTime dt = DateTime.Now;
            string   t  = dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day.ToString();

            this.DatePicker1.Text = DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd");
            this.DatePicker2.Text = DateTime.Now.ToString("yyyy-MM-dd");
            Btn_Detail_Click(null, null);
            Bind();
        }

        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
        AddOrderBLL.BindCurrency_Rate(Dropdownlist1);
        Dropdownlist1.SelectedValue = CountryBLL.GetCurrency();

        // 在此处放置用户代码以初始化页面
        Session["language"]       = LanguageBLL.GetDefaultLanguageTableName();
        Session["LanguegeSelect"] = LanguageBLL.GetDefaultlLanguageName();


        Translations();
    }
Ejemplo n.º 11
0
        public ActionResult Edit(int id)
        {
            CountryBLL objCountryBLL = new CountryBLL();
            var        country       = objCountryBLL.GetAllCountryById(id);

            return(View(country));
        }
Ejemplo n.º 12
0
        // GET: Admin/Country
        public ActionResult Index()
        {
            CountryBLL     objCountryBLL = new CountryBLL();
            List <Country> CountryList   = objCountryBLL.GetAllCountry();

            return(View(CountryList));
        }
Ejemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    if (Request.QueryString["id"] == null)
                    {
                        Response.Redirect("EmpList.aspx", false);
                    }
                    else
                    {
                        // loading countries
                        ddlCountries.DataSource = CountryBLL.GetAllCountry();
                        ddlCountries.DataBind();

                        Employee emp = EmployeeBLL.GetEmployee(Convert.ToInt32(Request.QueryString["id"]));
                        txtEmpID.Value             = emp.EmpID.ToString();
                        txtFirstName.Value         = emp.FirstName;
                        txtLastName.Value          = emp.LastName;
                        txtAge.Value               = emp.Age.ToString();
                        ddlCountries.SelectedValue = emp.CountryID.ToString();
                    }
                }
            }
            catch (Exception ex)
            {
                lbMsg.Text = "error";
                AppLogger.WriteLog(ex.ToString());
            }
        }
 public ActionResult Input(string id = "")
 {
     try
     {
         if (string.IsNullOrEmpty(id))
         {
             ViewBag.Title = "Create new Country";
             Country newSupplier = new Country()
             {
                 CountryID = 0
             };
             return(View(newSupplier));
         }
         else
         {
             ViewBag.Title = "Edit a Country";
             Country editCountry = CountryBLL.GetCountry(Convert.ToInt32(id));
             if (editCountry == null)
             {
                 return(RedirectToAction("Index"));
             }
             return(View(editCountry));
         }
     }
     catch (Exception ex)
     {
         return(Content(ex.Message + ":" + ex.StackTrace));
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Date Created: 29/07/2011
        /// Created By: Gabriel Oquialda
        /// (description) Loads vendor city to dropdownlist
        /// -----------------------------------------------------
        /// Date Modified:  05/Aug/2013
        /// Created By:     Josephine Gad
        /// (description)   Change Datatable to Session
        /// -----------------------------------------------------
        /// </summary>
        private void vendorCountryLoad()
        {
            List <CountryList> listCountry = new List <CountryList>();

            uoDropDownListCountry.Items.Clear();
            if (Session["CountryList"] != null)
            {
                listCountry = ((List <CountryList>)Session["CountryList"]);
                uoDropDownListCountry.DataSource     = listCountry;
                uoDropDownListCountry.DataTextField  = "CountryName";
                uoDropDownListCountry.DataValueField = "CountryId";
            }
            else
            {
                DataTable dtCountry = CountryBLL.CountryList();
                if (dtCountry.Rows.Count > 0)
                {
                    listCountry = (from a in dtCountry.AsEnumerable()
                                   select new CountryList
                    {
                        CountryId = GlobalCode.Field2Int(a["colCountryIDInt"]),
                        CountryName = GlobalCode.Field2String(a["colCountryNameVarchar"]),
                    }).ToList();

                    uoDropDownListCountry.DataSource     = listCountry;
                    uoDropDownListCountry.DataTextField  = "CountryName";
                    uoDropDownListCountry.DataValueField = "CountryId";

                    HttpContext.Current.Session["CountryList"] = listCountry;
                }
            }
            uoDropDownListCountry.Items.Insert(0, (new ListItem("--Select Country--", "0")));
            uoDropDownListCountry.DataBind();
        }
Ejemplo n.º 16
0
        public ActionResult Get()
        {
            CountryBLL countryBLL = new CountryBLL(WebApp.Connector);
            IEnumerable <CountryDTO> countries = countryBLL.ReadAll();

            return(Json(countries));
        }
        /// <summary>
        /// Author:         Josephine Gad
        /// Date Created:   19/10/2012
        /// Descrition:     binds country to listview
        /// </summary>

        private void BindCountry()
        {
            try
            {
                List <Country> list = new List <Country>();

                if (list.Count == 0)
                {
                    CountryBLL.GetCountryList();
                }
                list = CountryGenericClass.CountryList;
                uoDropDownListCountry.Items.Clear();
                uoDropDownListCountry.DataSource     = list;
                uoDropDownListCountry.DataTextField  = "CountryName";
                uoDropDownListCountry.DataValueField = "CountryID";
                uoDropDownListCountry.DataBind();

                uoDropDownListCountry.Items.Insert(0, new ListItem("--Select Country--", "0"));

                ////uoHiddenFieldRegionId.Value = GlobalCode.Field2String(Session["Region"]);
                //uoHiddenFieldRole.Value = GlobalCode.Field2String(Session["UserRole"]);;

                //uoNationalityList.Items.Clear();
                //uoNationalityList.DataSource = null;
                //uoNationalityList.DataSourceID = "ObjectDataSource1";
                //UpdatePanel2.Update();
                ////uoTextBoxSearchParam.Text = "";
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 18
0
 private void BindDropDownList()
 {
     this.ddlCountry.DataSource     = CountryBLL.GetCountryModels();
     this.ddlCountry.DataTextField  = "name";
     this.ddlCountry.DataValueField = "id";
     this.ddlCountry.DataBind();
 }
        protected void btn_Add_Click(object sender, EventArgs e)
        {
            string countryName   = txt_CountryName.Text;
            bool   checkinserted = CountryBLL.CheckNameInserted(countryName);

            if (!checkinserted)
            {
                CountryBLL.InsertNewCountry(countryName);
            }

            if (Request.QueryString["Redirect"] == "AddUserCountry")
            {
                Response.Redirect($"~/Pages/User/AddUserCountry.aspx");
            }

            if (Request.QueryString["Redirect"] == "MyProfile")
            {
                MembershipUser CurrentUser = Membership.GetUser();
                if (CurrentUser == null)
                {
                    Response.Redirect($"~/Pages/Common/MainLogin.aspx");
                }
                Guid UserId = (Guid)CurrentUser.ProviderUserKey;



                Response.Redirect($"~/Pages/User/MyProfile.aspx");
            }
        }
        /// <summary>
        /// Date Created: 19/08/2011
        /// Created By: Marco Abejar
        /// (description) Bind assigned region
        /// </summary>
        private void BindRegion()
        {
            DataTable RegionDataTable = null;

            try
            {
                RegionDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));
                uoDropDownListRegion.Items.Clear();
                ListItem item = new ListItem("--SELECT REGION--", "0");
                uoDropDownListRegion.Items.Add(item);
                uoDropDownListRegion.DataSource     = RegionDataTable;
                uoDropDownListRegion.DataTextField  = "colRegionNameVarchar";
                uoDropDownListRegion.DataValueField = "colRegionIDInt";
                uoDropDownListRegion.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RegionDataTable != null)
                {
                    RegionDataTable.Dispose();
                }
            }
        }
Ejemplo n.º 21
0
 public CountryForm(Country country)
 {
     _countryService = new CountryBLL();
     InitializeComponent();
     this.country = country;
     PopulateForm();
 }
Ejemplo n.º 22
0
 public ActionResult Input(Country model)
 {
     try
     {
         //TODO :Kiểm tra tính hợp lệ của dữ liệu nhập vào
         if (string.IsNullOrEmpty(model.CountryName))
         {
             ModelState.AddModelError("CountryName", "CountryName expected");
         }
         if (string.IsNullOrEmpty(model.Abbreviation))
         {
             model.Abbreviation = "";
         }
         //TODO :Lưu dữ liệu nhập vào
         if (model.CountryID == 0)
         {
             CountryBLL.AddCountry(model);
         }
         else
         {
             CountryBLL.UpdateCountry(model);
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         ModelState.AddModelError("", ex.Message + ":" + ex.StackTrace);
         return(View(model));
     }
 }
Ejemplo n.º 23
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Permissions.ComRedirect(Page, Permissions.redirUrl);
        if (!IsPostBack)
        {
            Response.Cache.SetExpires(DateTime.Now);
            Permissions.CheckManagePermission(EnumCompanyPermission.LogisticswuliuStateShow);

            this.DropCurrency.DataSource     = CountryBLL.GetCountryModels();
            this.DropCurrency.DataTextField  = "name";
            this.DropCurrency.DataValueField = "id";
            this.DropCurrency.DataBind();

            listCondition();

            Button1_Click(null, null);


            /*int year = DateTime.Now.Year;
             * int month = DateTime.Now.Month;
             * int lastDay = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.Month);
             *
             * txtBox_OrderDateTimeStart.Text = txtBox_ConsignmentDateTimeStart.Text = year + "-" + month + "-" + "01";
             * txtBox_OrderDateTimeEnd.Text = txtBox_ConsignmentDateTimeEnd.Text = year + "-" + month + "-" + lastDay;*/

            SetFanY();
        }

        AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxClass));
    }
Ejemplo n.º 24
0
        /// <summary>
        /// Date Created: 01/08/2011
        /// Created By: Marco Abejar
        /// (description) Loads port city to dropdownlist
        /// -----------------------------------------------
        /// Date Edited:    18/07/2012
        /// Created By:     Jefferson Bermundo
        /// (description)   Remove-- Port city not being used
        /// </summary>
        //private void PortCityLoad(int CountryID)
        //{
        //    DataTable dt = new DataTable();
        //    dt = CityBLL.CityListbyCountry(CountryID);
        //    if (dt.Rows.Count > 0)
        //    {
        //        uoDropDownListCity.DataSource = dt;
        //        uoDropDownListCity.DataTextField = "colCityNameVarchar";
        //        uoDropDownListCity.DataValueField = "colCityIDInt";
        //        uoDropDownListCity.DataBind();
        //        uoDropDownListCity.Items.Insert(0, new ListItem("- Select a City -", ""));
        //    }
        //    else
        //    {
        //        uoDropDownListCity.DataBind();
        //    }
        //}

        private void PortCountryLoad()
        {
            /// <summary>
            /// Date Created: 01/08/2011
            /// Created By: Marco Abejar
            /// (description) Loads port country to dropdownlist
            /// </summary>

            DataTable dt = new DataTable();

            dt = CountryBLL.CountryList();
            if (dt.Rows.Count > 0)
            {
                uoDropDownListCountry.DataSource     = dt;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
                uoDropDownListCountry.Items.Insert(0, new ListItem("- Select a Country -", ""));
                uoDropDownListCountry.SelectedValue = dt.Rows[0]["colCountryIDInt"].ToString();
            }
            else
            {
                uoDropDownListCountry.DataBind();
            }
        }
Ejemplo n.º 25
0
        //protected void uoDropDownListRegion_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    BindCountry();
        //    UpdatePanel2.Update();
        //}
        #endregion

        #region METHODS

        ///// <summary>
        ///// Date Created: 03/10/2011
        ///// Created By: Charlene Remotigue
        ///// Description: binds all regions to dropdownlist
        ///// </summary>
        //private void BindRegion()
        //{
        //    DataTable RegionDataTable = null;
        //    try
        //    {
        //        RegionDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));

        //        uoDropDownListRegion.Items.Clear();
        //        ListItem item = new ListItem("--Select Region--", "0");
        //        uoDropDownListRegion.Items.Add(item);
        //        uoDropDownListRegion.DataSource = RegionDataTable;
        //        uoDropDownListRegion.DataTextField = "colMapNameVarchar";
        //        uoDropDownListRegion.DataValueField = "colMapIDInt";
        //        uoDropDownListRegion.DataBind();

        //        item = new ListItem("--Select Country--", "0");
        //        uoDropDownListCountry.Items.Add(item);

        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    finally
        //    {
        //        if (RegionDataTable != null)
        //        {
        //            RegionDataTable.Dispose();
        //        }
        //    }
        //}

        /// <summary>
        /// Date Created: 03/10/2011
        /// Created By: Charlene Remotigue
        /// Descrition: binds country to dropdownlist
        /// </summary>

        private void BindCountry()
        {
            DataTable CountryDataTable = null;

            try
            {
                //CountryDataTable = CountryBLL.CountryListByRegion(uoDropDownListRegion.SelectedValue, "");
                CountryDataTable = CountryBLL.CountryList();
                uoDropDownListCountry.Items.Clear();
                ListItem item = new ListItem("--Select Country--", "0");
                uoDropDownListCountry.Items.Add(item);
                uoDropDownListCountry.DataSource     = CountryDataTable;
                uoDropDownListCountry.DataTextField  = "colCountryNameVarchar";
                uoDropDownListCountry.DataValueField = "colCountryIDInt";
                uoDropDownListCountry.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (CountryDataTable != null)
                {
                    CountryDataTable.Dispose();
                }
            }
        }
Ejemplo n.º 26
0
        protected void LoadRegion()
        {
            DataTable RegionDataTable = null;

            try
            {
                RegionDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));
                uoDropDownListRegion.Items.Clear();
                ListItem item = new ListItem("--Select Region--", "0");
                uoDropDownListRegion.Items.Add(item);
                uoDropDownListRegion.DataSource     = RegionDataTable;
                uoDropDownListRegion.DataTextField  = "colMapNameVarchar";
                uoDropDownListRegion.DataValueField = "colMapIDInt";
                uoDropDownListRegion.DataBind();

                if (GlobalCode.Field2String(Session["Region"]) != "")
                {
                    if (uoDropDownListRegion.Items.FindByValue(GlobalCode.Field2String(Session["Region"])) != null)
                    {
                        uoDropDownListRegion.SelectedValue = GlobalCode.Field2String(Session["Region"]);
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (RegionDataTable != null)
                {
                    RegionDataTable.Dispose();
                }
            }
        }
Ejemplo n.º 27
0
    /// <summary>
    /// 国家与仓库联动
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Country1_SelectedIndexChanged(object sender, EventArgs e)
    {
        DataView            dataev = new DataView(BillOutOrderBLL.GetWareHouseName());
        UserControl_Country cou    = Page.FindControl("Country1") as UserControl_Country;

        dataev.RowFilter         = "[CountryCode]=" + CountryBLL.GetCountryByCode(cou.CID);
        ddlcangku.DataSource     = dataev;
        ddlcangku.DataTextField  = "WareHouseName";
        ddlcangku.DataValueField = "WareHouseID";
        ddlcangku.DataBind();
        if (string.IsNullOrEmpty(ddlcangku.SelectedValue))
        {
            //ddlkuwei.DataSource = AddReportProfit.GetProductWareHouseInfo();
            //ddlkuwei.DataTextField = "name";
            //ddlkuwei.DataValueField = "id";
            //ddlkuwei.DataBind();
            //ddlkuwei.Enabled = false;
            //ddlcangku.Enabled = false;
            ddlcangku.Items.Add(new ListItem(GetTran("000592", "无仓库"), "-1"));
            ViewState["Ekuc"] = "false";
        }
        else
        {
            ViewState["Ekuc"] = "true";
        }
        ddlcangku_SelectedIndexChanged(null, null);
    }
Ejemplo n.º 28
0
        private void BindMapRef()
        {
            DataTable MapRefDataTable = null;

            try
            {
                MapRefDataTable = CountryBLL.MapListByUser(GlobalCode.Field2String(Session["UserName"]));
                uoDropDownListMapRef.Items.Clear();
                ListItem item = new ListItem("--Select Region--", "0");
                uoDropDownListMapRef.Items.Add(item);
                uoDropDownListMapRef.DataSource     = MapRefDataTable;
                uoDropDownListMapRef.DataTextField  = "colMapNameVarchar";
                uoDropDownListMapRef.DataValueField = "colMapIDInt";
                uoDropDownListMapRef.DataBind();

                //CommonFunctions.ChangeToUpperCase(uoDropDownListMapRef);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (MapRefDataTable != null)
                {
                    MapRefDataTable.Dispose();
                }
            }
        }
Ejemplo n.º 29
0
        // GET: /Brand/
        public ActionResult StoreList(int brandId = 0, int areaId = 0)
        {
            try
            {
                SupplierBrandBLL supplierBLL = new SupplierBrandBLL();

                var page = new PageDTO()
                {
                    PageIndex = PageNo, PageSize = DefaultPageSize
                };

                var result = supplierBLL.GetStoreListByBrandId(brandId, areaId, LanguageEnum.TraditionalChinese, page);

                ViewBag.Brand = supplierBLL.GetBrandById(brandId);

                ViewBag.ProvinceList = CountryBLL.GetProvinceList(852, LanguageEnum.TraditionalChinese);

                ViewBag.AreaId = areaId;

                return(View(result));
            }
            catch (Exception ex)
            {
                LogHelper.Error(ex);
            }
            return(View());
        }
        protected void btnActiveOrDeactive_Command(object sender, CommandEventArgs e)
        {
            try
            {
                string id = Convert.ToString(e.CommandArgument);
                if (!string.IsNullOrEmpty(id))
                {
                    CountryBLL countryBLL = new CountryBLL();
                    DataTable  dt         = countryBLL.GetById(Convert.ToInt32(QuaintSecurityManager.Decrypt(id)));
                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            string    actionStatus = "Updated";
                            Countries country      = new Countries();
                            country.CountryId         = Convert.ToInt32(Convert.ToString(dt.Rows[0]["CountryId"]));
                            country.CountryCode       = Convert.ToString(dt.Rows[0]["CountryCode"]);
                            country.Name              = Convert.ToString(dt.Rows[0]["Name"]);
                            country.CountryCodeAlpha2 = Convert.ToString(dt.Rows[0]["CountryCodeAlpha2"]);
                            country.CountryCodeAlpha3 = Convert.ToString(dt.Rows[0]["CountryCodeAlpha3"]);
                            country.Description       = Convert.ToString(dt.Rows[0]["Description"]);
                            country.IsActive          = Convert.ToBoolean(Convert.ToString(dt.Rows[0]["IsActive"]));
                            country.CreatedDate       = (string.IsNullOrEmpty(Convert.ToString(dt.Rows[0]["CreatedDate"]))) ? (DateTime?)null : Convert.ToDateTime(Convert.ToString(dt.Rows[0]["CreatedDate"]));
                            country.CreatedBy         = Convert.ToString(dt.Rows[0]["CreatedBy"]);
                            country.CreatedFrom       = Convert.ToString(dt.Rows[0]["CreatedFrom"]);

                            country.UpdatedDate = DateTime.Now;
                            country.UpdatedBy   = UserInfo;
                            country.UpdatedFrom = StationInfo;

                            if (country.IsActive)
                            {
                                country.IsActive = false;
                                actionStatus     = "Deactivated";
                            }
                            else
                            {
                                country.IsActive = true;
                                actionStatus     = "Activated";
                            }

                            if (countryBLL.Update(country))
                            {
                                Alert(AlertType.Success, actionStatus + " successfully.");
                                LoadList();
                            }
                            else
                            {
                                Alert(AlertType.Error, "Failed to update.");
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
                Alert(AlertType.Error, "Failed to process.");
            }
        }