Exemple #1
0
        public override void Init()
        {
            //逻辑对象赋值
            bll = PROD_KINDBll.GetInstence();

            ////表格对象赋值
            grid = Grid1;
        }
 /// <summary>
 /// 加载下拉列表
 /// </summary>
 public void LoadList()
 {
     FineUI.DropDownList ccPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
     PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, ccPROD_KIND);
     FineUI.DropDownList ccPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
     PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, ccPROD_DEP);
     FineUI.DropDownList ccPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
     PROD_CateBll.GetInstence().BandDropDownListShowCate(this, ccPROD_CATE);
 }
Exemple #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //获取ID值
                hidId.Text = RequestHelper.GetInt0("Id") + "";

                //绑定下拉列表
                PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, KIND_ID);

                //加载数据
                LoadData();
            }
        }
        /// <summary>
        /// 加载下拉列表
        /// </summary>
        public void LoadList()
        {
            var model = GetOnlineUserShop();

            SHOP00Bll.GetInstence().BindOnlineUser(this, model.SHOP_ID, ddlSHOP_NAME);
            STOCKBll.GetInstence().BandOnlineUserStock(this, model.SHOP_ID, ddlSTOCK_ID);
            STOCKBll.GetInstence().BandOnlineUserStock(this, model.SHOP_ID, ddlSTOCK_NAME1);
            FineUI.DropDownList ccPROD_KIND = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_KIND") as FineUI.DropDownList;
            PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, ccPROD_KIND);
            FineUI.DropDownList ccPROD_DEP = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_DEP") as FineUI.DropDownList;
            PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, ccPROD_DEP);
            FineUI.DropDownList ccPROD_CATE = Window3.FindControl("PanelGrid4").FindControl("Panel_Search").FindControl("ccPROD_CATE") as FineUI.DropDownList;
            PROD_CateBll.GetInstence().BandDropDownListShowCate(this, ccPROD_CATE);
        }
        /// <summary>
        /// 加载下拉列表
        /// </summary>
        public void LoadList()
        {
            PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, cPROD_KIND);
            PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, cPROD_DEP);
            PROD_CateBll.GetInstence().BandDropDownListShowCate(this, cPROD_CATE);
            //隶属部门
            BranchBll.GetInstence().BandDropDownListShowMenu(this, cDIV_ID);

            //绑定下拉列表
            PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, PROD_KIND);
            PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, PROD_DEP);
            PROD_CateBll.GetInstence().BandDropDownListShowCate(this, PROD_CATE);
            //隶属部门
            BranchBll.GetInstence().BandDropDownListShowMenu(this, DIV_ID);
            //单位
            PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT);
            PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT1);
            PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT2);

            SUPPLIERSBll.GetInstence().BandDropDownListShowSup(this, ddlSUPID);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //获取ID值
                hidId.Text = RequestHelper.GetInt0("Id") + "";

                //绑定下拉列表
                PROD_KINDBll.GetInstence().BandDropDownListShowKind(this, PROD_KIND);
                PROD_DEPBll.GetInstence().BandDropDownListShowDep(this, PROD_DEP);
                PROD_CateBll.GetInstence().BandDropDownListShowCate(this, PROD_CATE);
                //隶属部门
                BranchBll.GetInstence().BandDropDownListShowMenu(this, DIV_ID);
                //单位
                PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT);
                PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT1);
                PROD_UNITBll.GetInstence().BandDropDownListShowUnit(this, PROD_UNIT2);
                //加载数据
                LoadData();
            }
        }
        public override void LoadData()
        {
            //关闭窗口
            ButtonCancel.OnClientClick = ActiveWindow.GetHideReference();
            int id = ConvertHelper.Cint0(hidId.Text);

            if (id != 0)
            {
                //获取指定ID的菜单内容,如果不存在,则创建一个菜单实体
                //缓存机制有点问题,改直接初始化数据
                var model = PROD_KINDBll.GetInstence().GetModelForCache(x => x.Id == id);
                //var model = new PROD_UNIT(x => x.Id == id);
                if (model == null)
                {
                    return;
                }
                KIND_ID.Text         = model.KIND_ID;
                KIND_ID.Readonly     = true;
                KIND_NAME.Text       = model.KIND_NAME;
                KIND_MEMO.Text       = model.KIND_MEMO;
                ISBOM.SelectedValue  = model.ISBOM + "";
                ENABLE.SelectedValue = model.ENABLE + "";
            }
        }
        /// <summary>
        /// 数据保存
        /// </summary>
        /// <returns></returns>
        public override string Save()
        {
            string result = string.Empty;
            int    id     = ConvertHelper.Cint0(hidId.Text);

            try
            {
                #region 数据验证

                if (string.IsNullOrEmpty(KIND_ID.Text.Trim()))
                {
                    return(KIND_ID.Label + "不能为空!");
                }
                if (string.IsNullOrEmpty(KIND_NAME.Text.Trim()))
                {
                    return(KIND_NAME.Label + "不能为空!");
                }
                var sKind_id = StringHelper.Left(KIND_ID.Text, 50);
                if (PROD_KINDBll.GetInstence().Exist(x => x.KIND_ID == sKind_id) && id == 0)
                {
                    return(KIND_ID.Label + "已存在!请重新输入!");
                }

                //var sMeno = StringHelper.Left(UNIT_MENO.Text, 40);
                //if (UNIT_MENO.Text.Trim().Length > 40)
                //{
                //    return UNIT_MENO.Label + "超长!";
                //}

                #endregion

                #region 赋值

                var model = new PROD_KIND(x => x.Id == id);
                //var OlUser = new OnlineUsers(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == OnlineUsersBll.GetInstence().GetUserHashKey());
                //var OlUser = OnlineUsers.SingleOrDefault(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                model.KIND_ID   = KIND_ID.Text;
                model.KIND_NAME = KIND_NAME.Text;
                model.KIND_MEMO = KIND_MEMO.Text;
                model.ISBOM     = ConvertHelper.StringToByte(ISBOM.SelectedValue);
                model.ENABLE    = ConvertHelper.StringToByte(ENABLE.SelectedValue);
                if (id == 0)
                {
                    model.CRT_DATETIME = ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                    model.CRT_USER_ID  = OlUser.Manager_LoginName;
                }
                else
                {
                    model.CRT_DATETIME = model.CRT_DATETIME;
                    model.CRT_USER_ID  = model.CRT_USER_ID;
                }
                //model.CRT_USER_ID = "";
                model.MOD_DATETIME = ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                model.MOD_USER_ID  = OlUser.Manager_LoginName;
                //model.MOD_USER_ID = "";
                model.LAST_UPDATE = ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                model.STATUS      = 0;
                #endregion
                ////----------------------------------------------------------
                ////存储到数据库
                PROD_KINDBll.GetInstence().Save(this, model);
            }
            catch (Exception e)
            {
                result = "保存失败!";

                //出现异常,保存出错日志信息
                CommonBll.WriteLog(result, e);
            }

            return(result);
        }
Exemple #9
0
        /// <summary>
        /// Grid点击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            GridRow gr = Grid1.Rows[e.RowIndex];
            //获取当前点击列的主键ID
            object id = gr.DataKeys[0];


            //因为要记录修改人,修改时间跟最后更新时间,所以将单字段更新换成多字段更新
            switch (e.CommandName)
            {
            case "ENABLE":
                try
                {
                    var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("ENABLE", ConvertHelper.StringToByte(e.CommandArgument));
                    dic.Add("MOD_DATETIME", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
                    dic.Add("MOD_USER_ID", OlUser.Manager_LoginName);
                    dic.Add("LAST_UPDATE", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));

                    PROD_KINDBll.GetInstence().UpdateValue(this, ConvertHelper.Cint0(id), dic);
                    LoadData();
                    //PROD_KINDBll.GetInstence().Save(this, model);
                }
                catch (Exception err)
                {
                    //出现异常,保存出错日志信息
                    CommonBll.WriteLog("保存失败", err);
                }
                //更新状态
                //PROD_KINDBll.GetInstence().UpdateENABLE(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument));
                //重新加载
                //LoadData();

                break;

            case "ISBOM":
                try
                {
                    var OlUser = OnlineUsersBll.GetInstence().GetModelForCache(x => x.UserHashKey == Session[OnlineUsersTable.UserHashKey].ToString());
                    Dictionary <string, object> dic = new Dictionary <string, object>();
                    dic.Add("ISBOM", ConvertHelper.StringToByte(e.CommandArgument));
                    dic.Add("MOD_DATETIME", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));
                    dic.Add("MOD_USER_ID", OlUser.Manager_LoginName);
                    dic.Add("LAST_UPDATE", ConvertHelper.StringToDatetime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")));


                    PROD_KINDBll.GetInstence().UpdateValue(this, ConvertHelper.Cint0(id), dic);
                    LoadData();
                    //PROD_KINDBll.GetInstence().Save(this, model);
                }
                catch (Exception err)
                {
                    //出现异常,保存出错日志信息
                    CommonBll.WriteLog("保存失败", err);
                }
                //更新状态
                //PROD_KINDBll.GetInstence().UpdateISBOM(this, ConvertHelper.Cint0(id), ConvertHelper.Cint0(e.CommandArgument));
                //重新加载
                //LoadData();

                break;

            case "ButtonEdit":
                //打开编辑窗口
                Window1.IFrameUrl = "ProdKindEdit.aspx?Id=" + id + "&" + MenuInfoBll.GetInstence().PageUrlEncryptStringNoKey(id + "");
                Window1.Hidden    = false;

                break;
            }
        }