Esempio n. 1
0
        /// <summary>
        /// 获取仓库树数据源
        /// </summary>
        /// <returns></returns>
        public string GetWHList()
        {
            List <TreeNodeResult> list  = new List <TreeNodeResult>();
            WarehouseBLL          bll   = null;
            List <Warehouse>      array = null;

            try
            {
                bll   = BLLFactory.CreateBLL <WarehouseBLL>();
                array = bll.GetList();
                TreeNodeResult rootNode = new TreeNodeResult();
                rootNode.Tid   = "";
                rootNode.Ttext = "仓库";
                foreach (Warehouse info in array)
                {
                    TreeNodeResult node = new TreeNodeResult();
                    node.Tid   = info.ID;
                    node.Ttext = info.Code + "|" + info.Description;
                    rootNode.AddchildNode(node);
                }
                list.Add(rootNode);
                return(TreeNodeResult.GetResultJosnS(list.ToArray()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public string GetWarehouse(HttpContext context)
        {
            string        wmNo          = context.Request["WM"];
            WarehouseInfo warehouseInfo = new WarehouseBLL().GetList("", string.Empty).FirstOrDefault();

            return(JsonHelper.ToJson(warehouseInfo));
        }
Esempio n. 3
0
        private void LoadControls()
        {
            // Loading Warehoouse.

            List <WarehouseBLL> listWarehouse = new List <WarehouseBLL>();

            try
            {
                listWarehouse = WarehouseBLL.GetAllActiveWarehouse();
            }
            catch (Exception ex)
            {
                this.lblmsg.Text = ex.Message;
                return;
            }
            this.cboWarehouse.Items.Add(new ListItem("Please Select warehouse", ""));
            if (listWarehouse.Count > 0)
            {
                this.cboWarehouse.AppendDataBoundItems = true;
                foreach (WarehouseBLL ow in listWarehouse)
                {
                    this.cboWarehouse.Items.Add(new ListItem(ow.WarehouseName.ToString(), ow.WarehouseId.ToString()));
                }
                this.cboWarehouse.AppendDataBoundItems = false;
            }
        }
Esempio n. 4
0
        private void BindData()
        {
            WarehouseBLL bll       = null;
            DataPage     dp        = new DataPage();
            Warehouse    condition = new Warehouse();

            try
            {
                bll                   = BLLFactory.CreateBLL <WarehouseBLL>();
                condition.Code        = this.Code.Text.Trim();
                condition.Description = this.Description.Text.Trim();

                PagerHelper.InitPageControl(this.AspNetPager1, dp, true);
                dp = bll.GetList(condition, dp);

                List <Warehouse> list = dp.Result as List <Warehouse>;
                this.GvList.DataSource = list;
                this.GvList.DataBind();

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    string click = string.Format("return edit('{0}');", this.GvList.DataKeys[i]["ID"].ToString());

                    (this.GvList.Rows[i].Cells[4].Controls[0] as WebControl).Attributes.Add("onclick", click);
                }
                PagerHelper.SetPageControl(AspNetPager1, dp, true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 5
0
 public void BindWarehouse()
 {
     cboWarehouse.DataSource     = WarehouseBLL.GetAllActiveWarehouse();
     cboWarehouse.DataTextField  = "WarehouseName";
     cboWarehouse.DataValueField = "WarehouseId";
     cboWarehouse.DataBind();
 }
Esempio n. 6
0
        private void initData()
        {
            DataTable dt = new WarehouseBLL().GetList(null);

            dt.Columns[0].ColumnName = "id";
            dt.Columns[1].ColumnName = "name";
            DataRow dr = dt.NewRow();

            dr["id"]   = "";
            dr["name"] = "所有";
            dt.Rows.InsertAt(dr, 0);

            cmbWarehouse.DataSource    = dt;
            cmbWarehouse.DisplayMember = "name";
            cmbWarehouse.ValueMember   = "id";
            cmbWarehouse.SelectedIndex = 0;

            DataTable temp = new DataTable();

            for (int i = 0; i < 6; i++)
            {
                DataColumn column = new DataColumn();
                column.DataType   = System.Type.GetType("System.String");
                column.ColumnName = i.ToString();

                temp.Columns.Add(column);
            }
            this.dataGridView1.DataSource = temp;
            getName();
        }
Esempio n. 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string warehouseName = WarehouseBLL.GetWarehouseNameById(UserBLL.GetCurrentWarehouse());

            this.lblWN.Text = warehouseName;

            //str.Append("<table  align='center' border='1' bordercolor='#00aeef' width='99%' class='reporttable1' cellspacing='0' cellpadding='0' style='font-size:10;'>");
            //str.Append("<tr>");
            //str.Append("<td>");
            //str.Append("<b>S.No</b>");
            //str.Append("</td>");
            //str.Append("<td>");
            //str.Append("<b>Name</b>");
            //str.Append("</td>");
            //str.Append("</tr>");
            //str.Append("<tr>");
            //str.Append("<td>");
            //str.Append("1");
            //str.Append("</td>");
            //str.Append("<td>");
            //str.Append("Shubhang Mathur");
            //str.Append("</td>");
            //str.Append("</tr>");
            //str.Append("<tr>");
            //str.Append("<td>");
            //str.Append("2");
            //str.Append("</td>");
            //str.Append("<td>");
            //str.Append("Shubhang Sahai Mathur");
            //str.Append("</td>");
            //str.Append("</tr>");
            //str.Append("</table>".ToString());
        }
        public async Task <IActionResult> Edit([Bind("WarehouseCode,WarehouseName,WarehouseDesc,CompanyCode,Id,Is_Active,Created_Date,Created_By,Updated_Date,Updated_By")] M_Warehouse m_Warehouse)
        {
            if (ModelState.IsValid)
            {
                m_Warehouse.Updated_By = await base.CurrentUserId();

                ResultObject resultObj;

                try
                {
                    using (var whBll = new WarehouseBLL())
                    {
                        resultObj = await whBll.UpdateWarehouse(m_Warehouse);

                        _cache.Remove("CACHE_MASTER_WAREHOUSE");
                    }

                    return(Json(new { success = true, data = (M_Warehouse)resultObj.ObjectValue, message = "Warehouse Update." }));
                }
                catch (Exception ex)
                {
                    return(Json(new { success = false, data = m_Warehouse, message = ex.Message }));
                }
            }

            var err = ModelState.Values.SelectMany(x => x.Errors).Select(x => x.ErrorMessage).ToList();

            return(Json(new { success = false, errors = err, data = m_Warehouse, message = "Update Failed" }));
        }
Esempio n. 9
0
        /// <summary>
        /// 获取仓库权限
        /// </summary>
        /// <returns></returns>
        public string GetWarehouseList(Entity.Sys.User user)
        {
            List <TreeNodeResult> list    = new List <TreeNodeResult>();
            List <Warehouse>      whArray = null;

            try
            {
                whArray = new WarehouseBLL().GetList();
                foreach (Warehouse r in whArray)
                {
                    TreeNodeResult node = new TreeNodeResult();
                    node.Tid   = r.ID;
                    node.Ttext = r.Description;

                    node.TChecked = user.WHPowers.Exists(p => p.WarehouseID == r.ID);

                    list.Add(node);
                }
                return(TreeNodeResult.GetResultJosnS(list.ToArray()));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 10
0
        private void BindData()
        {
            string       id   = Request.QueryString["id"];
            WarehouseBLL bll  = null;
            Warehouse    info = new Warehouse();

            try
            {
                bll = BLLFactory.CreateBLL <WarehouseBLL>();
                if (string.IsNullOrEmpty(id) == false)
                {
                    info.ID = id;
                    info    = bll.Get(info);

                    UIBindHelper.BindForm(this.Page, info);
                    this.hiID.Value         = info.ID;
                    this.HiCREATEUSER.Value = info.CREATEUSER;
                    this.HiCREATETIME.Value = info.CREATETIME.ToString();
                }
                else
                {
                    info = new Warehouse();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 11
0
        public ActionResult Edit(string id)
        {
            Spl_WarehouseAllocationModel entity = m_BLL.GetById(id);

            ViewBag.FromWarehouse = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, ""), "Id", "Name", entity.FromWarehouseId);
            ViewBag.ToWarehouse   = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, ""), "Id", "Name", entity.ToWarehouseId);
            return(View(entity));
        }
Esempio n. 12
0
        public ActionResult Edit(string id)
        {
            Spl_WarehouseWarrantModel entity = m_BLL.GetById(id);

            ViewBag.Warehouse     = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()), "Id", "Name", entity.WarehouseId);
            ViewBag.InOutCategory = new SelectList(InOutCategoryBLL.GetList(ref setNoPagerAscById, "入库"), "Id", "Name", entity.InOutCategoryId);
            return(View(entity));
        }
        public async Task <IActionResult> DeleteConfirmed(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ResultObject resultObj;

            try
            {
                if (_cache.TryGetValue("CACHE_MASTER_WAREHOUSE", out List <M_Warehouse> c_lstWh))
                {
                    var m_Warehouse = c_lstWh.Find(w => w.Id == id);

                    if (m_Warehouse == null)
                    {
                        return(NotFound());
                    }

                    m_Warehouse.Updated_By = await base.CurrentUserId();

                    using (var whBll = new WarehouseBLL())
                    {
                        resultObj = await whBll.DeleteWarehouse(m_Warehouse);

                        _cache.Remove("CACHE_MASTER_WAREHOUSE");
                    }

                    return(Json(new { success = true, data = (M_Warehouse)resultObj.ObjectValue, message = "Warehouse Deleted." }));
                }

                using (var whBll = new WarehouseBLL())
                {
                    var lstWh = await whBll.GetWarehouse(id);

                    var m_Warehouse = lstWh.First();

                    if (m_Warehouse == null)
                    {
                        return(NotFound());
                    }

                    m_Warehouse.Updated_By = await base.CurrentUserId();

                    resultObj = await whBll.DeleteWarehouse(m_Warehouse);

                    _cache.Remove("CACHE_MASTER_WAREHOUSE");
                }

                return(Json(new { success = true, data = (M_Warehouse)resultObj.ObjectValue, message = "Warehouse Deleted." }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = ex.Message }));
            }
        }
        public JsonResult GetListParent(GridPager pager, string queryStr)
        {
            List <Spl_WarehouseModel>     list = WarehouseBLL.GetList(ref pager, queryStr, GetUserId());
            GridRows <Spl_WarehouseModel> grs  = new GridRows <Spl_WarehouseModel>();

            grs.rows  = list;
            grs.total = pager.totalRows;
            return(Json(grs));
        }
Esempio n. 15
0
        public static string StartWorkflowTask(Guid transactionType)
        {
            string transactionNo = null;

            ECXWF.ECXEngine eng = new WarehouseApplication.ECXWF.ECXEngine();
            eng.OpenTransaction(transactionType,
                                new Guid(SystemLookup.LookupSource.GetLookup("CurrentUser")["Id"]),
                                new string[] { "" }, WarehouseBLL.GetWarehouseCode(UserBLL.GetCurrentWarehouse()), out transactionNo);
            return(transactionNo);
        }
Esempio n. 16
0
 private void FillWareHouse()
 {
     drpWarehouse.Items.Clear();
     drpWarehouse.Items.AddRange(
         (from warehouse in WarehouseBLL.GetAllActiveWarehouse()
          select new ListItem()
     {
         Text = warehouse.WarehouseName, Value = warehouse.WarehouseId.ToString()
     }).ToArray());
     drpWarehouse.Items.Insert(0, new ListItem("Select", string.Empty));
 }
Esempio n. 17
0
        protected void btDelete_Click(object sender, EventArgs e)
        {
            ArrayList     pkArray = null;
            WarehouseBLL  bll     = null;
            List <string> msgList = new List <string>();

            try
            {
                bll = BLLFactory.CreateBLL <WarehouseBLL>();

                pkArray = GvHelper.GetPKValueByChk(this.GvList, 0, "cbxSelect", 0);

                if (pkArray.Count == 0)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','请选择要删除的记录');", true);
                    return;
                }

                for (int i = 0; i < this.GvList.Rows.Count; i++)
                {
                    CheckBox cbxSelect = this.GvList.Rows[i].Cells[0].FindControl("cbxSelect") as CheckBox;

                    if (cbxSelect.Checked == false)
                    {
                        continue;
                    }

                    Warehouse site = new Warehouse();
                    site.ID          = this.GvList.DataKeys[i]["ID"].ToString();
                    site.Description = this.GvList.Rows[i].Cells[1].Text;

                    //判断是否已使用
                    bool r = bll.IsUse(site);
                    if (r == true)
                    {
                        msgList.Add(site.Description);
                        continue;
                    }

                    //删除
                    bll.Delete(site);
                }
                string msg = string.Join(",", msgList.ToArray());
                if (msg != "")
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + msg + "仓库已使用,无法删除');", true);
                }
                this.BindData();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 18
0
        private void BindWHList()
        {
            WarehouseBLL     bll   = null;
            List <Warehouse> array = null;

            bll   = BLLFactory.CreateBLL <WarehouseBLL>();
            array = bll.GetList();

            this.Warehouse.DataSource = array;
            this.Warehouse.DataBind();
        }
Esempio n. 19
0
        public JsonResult GetComboxDataByWarehouse()
        {
            List <Spl_WarehouseModel> list = WarehouseBLL.GetList(ref setNoPagerAscById, "");
            var json = (from r in list
                        select new Spl_ProductCategoryModel()
            {
                Id = r.Id,
                Name = r.Name
            }).ToArray();

            return(Json(json));
        }
Esempio n. 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack != true)
            {
                Page.DataBind();
                try
                {
                    this.cboCommodity.Items.Add(new ListItem("Please Select Commodity", ""));
                    this.cboCommodity.AppendDataBoundItems = true;
                    ECXLookUp.ECXLookup    objEcxLookUp = new WarehouseApplication.ECXLookUp.ECXLookup();
                    ECXLookUp.CCommodity[] objCommodity = objEcxLookUp.GetActiveCommodities(Utility.GetWorkinglanguage());
                    this.cboCommodity.DataSource     = objCommodity;
                    this.cboCommodity.DataTextField  = "Name";
                    this.cboCommodity.DataValueField = "UniqueIdentifier";
                    this.cboCommodity.DataBind();
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                try
                {
                    // get the type of the current warehoouse.


                    this.cboWarehouse.Items.Add(new ListItem("Please Select Warehouse", ""));
                    this.cboWarehouse.AppendDataBoundItems = true;
                    List <WarehouseBLL> listWarehouse = WarehouseBLL.GetAllActiveWarehouse();
                    foreach (WarehouseBLL owarehouse in listWarehouse)
                    {
                        this.cboWarehouse.Items.Add(new ListItem(owarehouse.WarehouseName, owarehouse.WarehouseId.ToString()));
                    }
                    this.cboWarehouse.SelectedValue = UserBLL.GetCurrentWarehouse().ToString();
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                int currYear;
                currYear = int.Parse(ConfigurationSettings.AppSettings["CurrentEthiopianYear"]);
                this.cboProductionYear.Items.Add(new ListItem("Please Select Production Year.", ""));
                this.cboProductionYear.AppendDataBoundItems = true;
                for (int i = currYear - 2; i <= currYear; i++)
                {
                    this.cboProductionYear.Items.Add(new ListItem(i.ToString(), i.ToString()));
                }
            }
            else
            {
            }
        }
Esempio n. 21
0
        public ActionResult Create()
        {
            ViewBag.FromWarehouse = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()), "Id", "Name");
            ViewBag.ToWarehouse   = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, ""), "Id", "Name");
            AccountModel accountModel          = GetAccount();
            Spl_WarehouseAllocationModel model = new Spl_WarehouseAllocationModel()
            {
                Id = "DBD" + DateTime.Now.ToString("yyyyMMddHHmmssff"),
                //  Handler = accountModel.Id,
                Handler     = accountModel.TrueName,
                HandlerName = accountModel.TrueName,
            };

            return(View(model));
        }
Esempio n. 22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     UserBLL.Expire(UserBLL.CurrentUser.UserId);
     if (!IsPostBack)
     {
         ddlWarehouse.Items.Clear();
         ddlWarehouse.Items.AddRange(
             (from warehouse in WarehouseBLL.GetAllActiveWarehouse()
              select new ListItem()
         {
             Text = warehouse.WarehouseName, Value = warehouse.WarehouseId.ToString()
         }).ToArray());
         this.Page.Title = "ECX Warehouse Application";
     }
 }
        public ActionResult Create()
        {
            ViewBag.Warehouse     = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()), "Id", "Name");
            ViewBag.InOutCategory = new SelectList(InOutCategoryBLL.GetList(ref setNoPagerAscById, "出库"), "Id", "Name");
            AccountModel accountModel          = GetAccount();
            Spl_WarehouseWarrantOUTModel model = new Spl_WarehouseWarrantOUTModel()
            {
                Id = "CKD" + DateTime.Now.ToString("yyyyMMddHHmmssff"),
                //  Handler = accountModel.Id,
                Handler     = accountModel.TrueName,
                HandlerName = accountModel.TrueName,
            };

            ViewBag.Checker = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()), "Id", "ContactPerson").Distinct();
            return(View(model));
        }
Esempio n. 24
0
        public ActionResult Create()
        {
            ViewBag.Warehouse     = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()), "Id", "Name");
            ViewBag.InOutCategory = new SelectList(InOutCategoryBLL.GetList(ref setNoPagerAscById, "入库"), "Id", "Name");
            AccountModel accountModel       = GetAccount();
            Spl_WarehouseWarrantModel model = new Spl_WarehouseWarrantModel()
            {
                Id          = "RKD" + DateTime.Now.ToString("yyyyMMddHHmmssff"),
                Handler     = accountModel.TrueName,
                HandlerName = accountModel.TrueName,
            };

            ViewBag.Checker = new SelectList(WarehouseBLL.GetList(ref setNoPagerAscById, "", GetUserId()).GroupBy(p => new { p.Id, p.ContactPerson }).Select(g => new { Id = g.Key.Id, ContactPerson = g.Key.ContactPerson }), "Id", "ContactPerson");

            return(View(model));
        }
Esempio n. 25
0
        private void HandleEquipmentTypesRequest()
        {
            // 设备类型
            var types = new EquipmentTypeBLL().FindList(f => f.Delete == false).OrderBy(o => o.Name).ToList();
            // 设备型号
            var models = new EquipmentModelBLL().FindList(f => f.Delete == false).OrderBy(o => o.Type).ThenBy(t => t.Name).ToList();
            // 仓库
            var houses = new WarehouseBLL().FindList(f => f.Delete == false).OrderBy(o => o.Name).ToList();
            // 设备状态类别
            var statuses = new EquipmentStatusBLL().FindList(null).OrderBy(o => o.Name).ToList();
            // 设备状态码
            //var codes = new EquipmentStatusCodeBLL().FindList(null).OrderBy(o => o.Status).ThenBy(t => t.Name).ToList();

            var ret = "{\"types\":" + JsonConverter.ToJson(types) + ",\"models\":" +
                      JsonConverter.ToJson(models) + ",\"warehouses\":" + JsonConverter.ToJson(houses) +
                      ",\"statuses\":" + JsonConverter.ToJson(statuses) + "}";

            ResponseJson(ret);
        }
Esempio n. 26
0
        private void LoadControls()
        {
            // Loading Warehoouse.

            List <WarehouseBLL> listWarehouse = new List <WarehouseBLL>();

            try
            {
                listWarehouse = WarehouseBLL.GetAllActiveWarehouse();
            }
            catch (Exception ex)
            {
                this.lblmsg.Text = ex.Message;
                return;
            }
            //this.cboWarehouse.Items.Add( new ListItem("Please Select warehouse",""));
            if (listWarehouse.Count > 0)
            {
                this.cboWarehouse.AppendDataBoundItems = true;
                foreach (WarehouseBLL ow in listWarehouse)
                {
                    if (ow.WarehouseId == UserBLL.GetCurrentWarehouse())
                    {
                        this.cboWarehouse.Items.Add(new ListItem(ow.WarehouseName.ToString(), ow.WarehouseId.ToString()));
                        this.cboWarehouse.SelectedValue = ow.WarehouseId.ToString();
                    }
                }
                this.cboWarehouse.AppendDataBoundItems = false;
                WarehouseChanged();
            }
            //productionyearStack
            int currYear;

            currYear = int.Parse(ConfigurationSettings.AppSettings["CurrentEthiopianYear"]);
            this.cboProductionYear.Items.Clear();
            this.cboProductionYear.Items.Add(new ListItem("Please Select Production Year.", ""));
            this.cboProductionYear.AppendDataBoundItems = true;
            for (int i = currYear - 2; i <= currYear; i++)
            {
                this.cboProductionYear.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
        }
        // GET: Master/Warehouse/Edit/5
        public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            ViewBag.CompCode = base.CurrentUserComp();

            try
            {
                if (_cache.TryGetValue("CACHE_MASTER_WAREHOUSE", out List <M_Warehouse> c_lstWh))
                {
                    var m_Warehouse = c_lstWh.Find(w => w.Id == id);

                    if (m_Warehouse == null)
                    {
                        return(NotFound());
                    }

                    return(PartialView(m_Warehouse));
                }

                using (var whBll = new WarehouseBLL())
                {
                    var lstWh = await whBll.GetWarehouse(id);

                    var m_Warehouse = lstWh.First();

                    if (m_Warehouse == null)
                    {
                        return(NotFound());
                    }

                    return(PartialView(m_Warehouse));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(new { success = false, message = ex.Message }));
            }
        }
Esempio n. 28
0
        protected void btSave_Click(object sender, EventArgs e)
        {
            Warehouse        info   = new Warehouse();
            WarehouseBLL     bll    = null;
            DataResult <int> result = null;

            try
            {
                UIBindHelper.BindModelByControls(this.Page, info);

                bll = BLLFactory.CreateBLL <WarehouseBLL>();

                if (this.hiID.Value == "")
                {
                    result = bll.Insert(info);
                }
                else
                {
                    info.CREATEUSER = this.HiCREATEUSER.Value;
                    info.CREATETIME = DateTime.Parse(this.HiCREATETIME.Value);
                    info.ID         = this.hiID.Value;
                    result          = bll.Update(info);
                }

                if (string.IsNullOrEmpty(result.Msg) == false)
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "MSI('提示','" + result.Msg + "')", true);
                }
                else
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "myjs", "parent.refreshData();parent.closeAppWindow1();", true);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 29
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //string lblLoggedUser = HttpContext.Current.User.Identity.Name.Remove(0, HttpContext.Current.User.Identity.Name.LastIndexOf(@"\") + 1);
     //if ((this.Session["LoggedUser"] == null && this.Session["LoggedUserName"] == null) ||
     //    (this.Session["LoggedUser"] != null && this.Session["LoggedUserName"] != null && this.Session["LoggedUserName"].ToString() != lblLoggedUser))
     //{
     //    Guid? UserGuid = UserBLL.GetUser(lblLoggedUser);
     //    if (UserGuid == null)
     //    {
     //        FormsAuthentication.SignOut();
     //        Response.Redirect(ConfigurationManager.AppSettings["lbLoggoffISAURL"]);
     //    }
     //    else
     //    {
     //        this.Session["LoggedUser"] = UserGuid;
     //        this.Session["LoggedUserName"] = lblLoggedUser;
     //    }
     //}
     this.Page.Title = "ECX Warehouse Application";
     //LOAD WAREHOUSE
     lblWarehouse.Text = WarehouseBLL.GetWarehouseNameById(new Guid(UserBLL.GetCurrentWarehouse().ToString())).ToUpper() + " Warehouse".ToUpper();
     lblUserName.Text  = UserBLL.GetName(UserBLL.GetCurrentUser());
 }
Esempio n. 30
0
        private void PlaceSetForm_Load(object sender, EventArgs e)
        {
            #region 设置货区 数据源
            this.dgv_area.DataSource       = abll.GetList(null);
            dgv_area.Columns[0].HeaderText = "货区编码";
            dgv_area.Columns[1].HeaderText = "货区名称";
            dgv_area.Columns[2].HeaderText = "备注";
            #endregion

            #region combox
            DataTable dt = new WarehouseBLL().GetList(null);
            dt.Columns[0].ColumnName = "id";
            dt.Columns[1].ColumnName = "name";
            DataRow dr = dt.NewRow();
            dr["id"]   = "";
            dr["name"] = "所有";
            dt.Rows.InsertAt(dr, 0);

            cmbJia.DataSource    = dt;
            cmbJia.DisplayMember = "name";
            cmbJia.ValueMember   = "id";
            cmbJia.SelectedIndex = 0;

            cmbLie.DataSource    = initCC();
            cmbLie.DisplayMember = "name";
            cmbLie.ValueMember   = "id";
            cmbLie.SelectedIndex = 0;

            cmbCeng.DataSource    = initCC();
            cmbCeng.DisplayMember = "name";
            cmbCeng.ValueMember   = "id";
            cmbCeng.SelectedIndex = 0;
            #endregion
            initFlag = true;
            setPlaceData();
        }