/// <summary>
        /// 测试分页排序
        /// </summary>
        /// <param name="model"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageCount"></param>
        /// <param name="ord"></param>
        /// <param name="TotalCount"></param>
        /// <returns></returns>
        public static DataTable GetLitBycondition(StorageModel model, int pageIndex, int pageCount, string ord, ref int TotalCount)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select a.ID,a.StorageNo,ISNULL(a.StorageName,'') as StorageName  ,isnull(b.EmployeeName,'') as CanViewUserName,a.StorageType,a.UsedStatus,ISNULL(a.Remark,'') as Remark ");
            sql.AppendLine("from officedba.StorageInfo a");
            sql.AppendLine("left outer join officedba.EmployeeInfo b on a.StorageAdmin=b.ID");
            sql.AppendLine("   where a.CompanyCD='" + model.CompanyCD + "'");
            SqlCommand comm = new SqlCommand();
            //添加公司代码参数
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));
            if (!string.IsNullOrEmpty(model.StorageNo))
            {
                sql.AppendLine("	and a.StorageNo like '%'+ @StorageNo +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageNo", model.StorageNo));
            }
            if (!string.IsNullOrEmpty(model.StorageName))
            {
                sql.AppendLine(" and a.StorageName like '%'+ @StorageName +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageName", model.StorageName));
            }

            if (!string.IsNullOrEmpty(model.StorageType))
            {
                sql.AppendLine(" and a.StorageType = @StorageType");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageType", model.StorageType));
            }
            if (!string.IsNullOrEmpty(model.UsedStatus))
            {
                sql.AppendLine(" and a.UsedStatus = @UsedStatus");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@UsedStatus", model.UsedStatus));
            }

            comm.CommandText = sql.ToString();
            return SqlHelper.PagerWithCommand(comm, pageIndex, pageCount, ord, ref TotalCount);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        if (!IsPostBack)
        {
            BindCom();
            HiddenPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;//小数位

            GetBillExAttrControl1.TableName = "officedba.Productinfo";
            string EFIndex = Request.QueryString["EFIndex"];
            string EFDesc = Request.QueryString["EFDesc"];
            GetBillExAttrControl1.ExtIndex = EFIndex;
            GetBillExAttrControl1.ExtValue = EFDesc;
            GetBillExAttrControl1.SetExtControlValue();

            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt1 = StorageBus.GetStorageListBycondition(model);
            if (dt1.Rows.Count > 0)
            {
                ddlStorage.DataSource = dt1;
                ddlStorage.DataTextField = "StorageName";
                ddlStorage.DataValueField = "ID";
                ddlStorage.DataBind();
                ddlStorage.Items.Insert(0, new ListItem("--请选择--", ""));
            }
            //this.txtStartDate.Text = System.DateTime.Now.AddDays(1 - System.DateTime.Now.Day).ToString("yyyy-MM-dd");
            //this.txtEndDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
            this.hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEJOURNAL;



            //点击查询时,设置查询的条件,并执行查询
            if (Request.QueryString["Flag"] != null)
            {
                this.ddlStorage.SelectedValue = Request.QueryString["ddlStorage"].ToString();
                this.txtProductNo.Value = Request.QueryString["txtProductNo"].ToString();
                //this.txtProductName.Value = Request.QueryString["txtProductName"].ToString();
                this.txtStartDate.Text = Request.QueryString["StartDate"].ToString();
                this.txtEndDate.Text = Request.QueryString["EndDate"].ToString();
                this.hiddenProductID.Value = Request.QueryString["ProductID"].ToString();
                //获取当前页
                string pageIndex = Request.QueryString["pageIndex"];
                //获取每页显示记录数 
                string pageCount = Request.QueryString["pageCount"];
                //执行查询
                //ClientScript.RegisterStartupScript(this.GetType(), "Fun_Search_StorageInfo"
                //        , "<script language=javascript>this.pageCount = parseInt(" + pageCount + ");Fun_Search_StorageInfo('" + pageIndex + "');</script>");
            }

        }
      
    }
Beispiel #3
0
 public static DataTable GetStorageListByRed(StorageModel model)
 {
     try
     {
         return StorageDBHelper.GetStorageTableByRed(model);
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
 /// <summary>
 /// 查询仓库信息
 /// </summary>
 /// <returns>DataTable</returns>
 public static DataTable GetStorageListBycondition(StorageModel model, string orderby)
 {
     try
     {
         return StorageDBHelper.GetStorageTableBycondition(model, orderby);
     }
     catch (System.Exception ex)
     {
         throw ex;
     }
 }
    protected void btnImport_Click(object sender, ImageClickEventArgs e)
    {
        StorageModel model = new StorageModel();
        model.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        model.StorageNo = txtStorageNo.Value.Trim();
        model.StorageName = txtStorageName.Value.Trim();
        model.StorageType = sltType.Value;
        model.UsedStatus = sltUsedStatus.Value;
        string orderBy = txtorderBy.Value;
        if (!string.IsNullOrEmpty(orderBy))
        {
            if (orderBy.Split('_')[1] == "a")
            {
                orderBy = orderBy.Split('_')[0] + " asc";
            }
            else
            {
                orderBy = orderBy.Split('_')[0] + " desc";
            }
        }
        DataTable dt = StorageBus.GetStorageListBycondition(model, orderBy);

        foreach (DataRow dr in dt.Rows)
        {
            if (dr["StorageType"].ToString() == "0")
            {
                dr["StorageType"] = "一般库";
            }
            else if (dr["StorageType"].ToString() == "1")
            {
                dr["StorageType"] = "委托代销库";
            }
            else if (dr["StorageType"].ToString() == "2")
            {
                dr["StorageType"] = "贵重物品库";
            }

            if (dr["UsedStatus"].ToString() == "1")
            {
                dr["UsedStatus"] = "已启用";
            }
            else
            {
                dr["UsedStatus"] = "未启用";
            }
        }
        OutputToExecl.ExportToTableFormat(this, dt,
            new string[] { "仓库编号", "仓库名称", "仓库类型", "仓库状态", "仓管员","仓库说明" },
            new string[] { "StorageNo", "StorageName", "StorageType", "UsedStatus", "CanViewUserName", "Remark" },
            "仓库列表");

    }
 protected void BindStorageInfo()
 {
     StorageModel model = new StorageModel();
     model.CompanyCD = UserInfo.CompanyCD;
     model.UsedStatus = "1";
     DataTable dt = StorageBus.GetStorageListBycondition(model);
     if (dt != null && dt.Rows.Count > 0)
     {
         ddlStorageID.DataSource = dt;
         ddlStorageID.DataTextField = "StorageName";
         ddlStorageID.DataValueField = "ID";
         ddlStorageID.DataBind();
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         BindCom();
         BindTree();
         HiddenPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;//小数位
         //扩展属性
         GetBillExAttrControl1.TableName = "officedba.ProductInfo";
         string EFIndex = Request.QueryString["EFIndex"];
         string EFDesc = Request.QueryString["EFDesc"];
       
         GetBillExAttrControl1.ExtIndex = EFIndex;
         GetBillExAttrControl1.ExtValue = EFDesc;
         GetBillExAttrControl1.SetExtControlValue();
         //获取仓库列表
         StorageModel model = new StorageModel();
         model.CompanyCD = UserInfo.CompanyCD;
         model.UsedStatus = "1";
         DataTable dt1 = StorageBus.GetStorageListBycondition2(model);
         if (dt1.Rows.Count > 0)
         {
             ddlStorage.DataSource = dt1;
             ddlStorage.DataTextField = "StorageName";
             ddlStorage.DataValueField = "ID";
             ddlStorage.DataBind();
             ddlStorage.Items.Insert(0, new ListItem("--请选择--", ""));
         }
         //获取材质列表
         string typeflag = "5";
         string typecode = "5";
         DataTable dt2 = XBase.Business.Office.SystemManager.CodePublicTypeBus.GetCodePublicByCode(typeflag, typecode);
         if (dt2.Rows.Count > 0)
         {
             ddlMaterial.DataSource = dt2;
             ddlMaterial.DataTextField = "TypeName";
             ddlMaterial.DataValueField = "ID";
             ddlMaterial.DataBind();
             ddlMaterial.Items.Insert(0, new ListItem("--请选择--", ""));
         }
     }
 }
    protected void BindStorageInfo()
    {
        StorageModel model = new StorageModel();
        model.CompanyCD = GetCurrentUserInfo().CompanyCD;
        model.UsedStatus = "1";
        DataTable dt = StorageBus.GetStorageListBycondition(model);
        if (dt != null && dt.Rows.Count > 0)
        {
            ddlInStorageID.DataSource = dt;
            ddlInStorageID.DataTextField = "StorageName";
            ddlInStorageID.DataValueField = "ID";
            ddlInStorageID.DataBind();
            ddlInStorageID.Items.Insert(0, new ListItem("--请选择--", "-1"));

            ddlOutStorageID.DataSource = dt;
            ddlOutStorageID.DataTextField = "StorageName";
            ddlOutStorageID.DataValueField = "ID";
            ddlOutStorageID.DataBind();
            ddlOutStorageID.Items.Insert(0, new ListItem("--请选择--", "-1"));
        }
    }
        /// <summary>
        /// 根据查询条件获取仓库列表(库存查询中用到,可查看人员过滤仓库)
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DataTable GetStorageTableBycondition2(StorageModel model)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select ID,StorageNo,StorageName,StorageType,UsedStatus,ISNULL(Remark,'') as Remark ");
            sql.AppendLine("from officedba.StorageInfo");
            sql.AppendLine("   where CompanyCD='" + model.CompanyCD + "'");
            SqlCommand comm = new SqlCommand();
            //过滤单据:显示当前用户拥有权限查看的单据
            int empid = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID;
            sql.AppendLine(" and ( charindex('," + empid + ",' , ','+CanViewUser+',')>0 or StorageAdmin=" + empid + " OR CanViewUser='' OR CanViewUser is null) ");

            //添加公司代码参数
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));
            if (!string.IsNullOrEmpty(model.StorageNo))
            {
                sql.AppendLine("	and StorageNo like '%'+ @StorageNo +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageNo", model.StorageNo));
            }
            if (!string.IsNullOrEmpty(model.StorageName))
            {
                sql.AppendLine(" and StorageName like '%'+ @StorageName +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageName", model.StorageName));
            }

            if (!string.IsNullOrEmpty(model.StorageType))
            {
                sql.AppendLine(" and StorageType = @StorageType");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageType", model.StorageType));
            }
            if (!string.IsNullOrEmpty(model.UsedStatus))
            {
                sql.AppendLine(" and UsedStatus = @UsedStatus");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@UsedStatus", model.UsedStatus));
            }

            comm.CommandText = sql.ToString();
            return SqlHelper.ExecuteSearch(comm);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        if (!IsPostBack)
        {
            //启用小数位数,默认2位
            hidSelPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;

            //新建模块ID
            hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEINITAIL_ADD;
            //扩展属性
            GetBillExAttrControl1.TableName = "officedba.StorageInitail";
            string EFIndex = Request.QueryString["EFIndex"];
            string EFDesc = Request.QueryString["EFDesc"];
            GetBillExAttrControl1.ExtIndex = EFIndex;
            GetBillExAttrControl1.ExtValue = EFDesc;
            GetBillExAttrControl1.SetExtControlValue();
            //仓库下拉
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt = StorageBus.GetStorageListBycondition(model);
            if (dt.Rows.Count > 0)
            {
                sltStorageID.DataSource = dt;
                sltStorageID.DataTextField = "StorageName";
                sltStorageID.DataValueField = "ID";
                sltStorageID.DataBind();
            }
            sltStorageID.Items.Insert(0, new ListItem("--请选择--", ""));

            //返回处理

            string requestParam = Request.QueryString.ToString();
            //从列表过来时
            int firstIndex = requestParam.IndexOf("&");
            //返回回来时
            if (firstIndex > 0)
            {
                //获取是否查询的标识
                string flag = Request.QueryString["Flag"];
                //点击查询时,设置查询的条件,并执行查询
                if ("1".Equals(flag))
                {
                    txtInNo.Value = Request.QueryString["InNO"];
                    txtTitle.Value = Request.QueryString["Title"];
                    sltStorageID.SelectedValue = Request.QueryString["StorageID"];
                    DeptName.Value = Request.QueryString["DeptName"];
                    txtDeptID.Value = Request.QueryString["Dept"];
                    UsertxtExecutor.Value = Request.QueryString["UsertxtExecutor"];
                    txtExecutorID.Value = Request.QueryString["txtExecutor"];
                    sltBillStatus.Value = Request.QueryString["sltBillStatus"];
                    txtEnterDateStart.Value = Request.QueryString["EnterDateStart"];
                    txtEnterDateEnd.Value = Request.QueryString["EnterDateEnd"];
                    txtBatchNo.Value = Request.QueryString["BatchNo"];
                    //txtInNo.Attributes.Add("title", Request.QueryString["InNO"]);

                    //获取当前页
                    string pageIndex = Request.QueryString["pageIndex"];
                    //获取每页显示记录数 
                    string pageCount = Request.QueryString["pageCount"];
                    //执行查询
                    ClientScript.RegisterStartupScript(this.GetType(), "DoSearch"
                            , "<script language=javascript>this.pageCount = parseInt(" + pageCount + ");DoSearch('" + pageIndex + "');</script>");
                }
            }
        }


    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HiddenNow.Value = System.DateTime.Now.ToShortDateString();
        HiddenIsZero.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsZero.ToString();//是否允许价格为零
        string OutNoID = Request.QueryString["OutNoID"];
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        HiddenPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;//小数位
        HiddenMoreUnit.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit.ToString();//是否启用多计量单位
        UserTransactor.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();
        txtTransactorID.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID.ToString();
        txtOutDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsDisplayPrice)
            IsDisplayPrice.Value = "true";
        else
            IsDisplayPrice.Value = "false";


        if (!IsPostBack)
        {
            txtOutNo.CodingType = ConstUtil.CODING_RULE_Storage_NO;
            txtOutNo.ItemTypeID = ConstUtil.CODING_RULE_StorageOut_NO;
            if (OutNoID != "" && OutNoID != null)
            {
                txtIndentityID.Value = OutNoID;//给隐藏域赋主键
            }
            else
            {
                this.txtCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();//制单人
                this.txtCreateDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");

                this.txtModifiedUserID.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID.ToString();//最后更新人
                this.txtModifiedDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给最后更新时间日期赋值
            }
            if (OutNoID != "" && OutNoID != null)
            {
                this.div_OutNo_uc.Attributes.Add("style", "display:none;");
                this.div_OutNo_Lable.Attributes.Add("style", "display:block;");
            }
            else
            {
                this.div_OutNo_uc.Attributes.Add("style", "display:block;");
                this.div_OutNo_Lable.Attributes.Add("style", "display:none;");
            }
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt = StorageBus.GetStorageListBycondition(model);
            if (dt.Rows.Count > 0)
            {
                ddlStorageInfo.DataSource = dt;
                ddlStorageInfo.DataTextField = "StorageName";
                ddlStorageInfo.DataValueField = "ID";
                ddlStorageInfo.DataBind();
            }

            //模板列表模块ID
            hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEOUTSELL_LIST;
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //返回按钮可见
                btnBack.Visible = true;
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_STORAGE_STORAGEOUTSELL_LIST, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
            }
            else
            {
                //返回按钮不可见
                btnBack.Visible = false;
            }
        }

    }
    //#region From Type
    //public int intFromType
    //{
    //    get
    //    {
    //        int tempID = 0;
    //        int.TryParse(Request["intFromType"], out tempID);
    //        return tempID;
    //    }
    //}
    //#endregion

    protected void Page_Load(object sender, EventArgs e)
    {
        string LossNoID = Request.QueryString["LossNoID"];
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
        btnGetGoods.Visible = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsBarCode;
        HiddenPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;//小数位
        HiddenMoreUnit.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit.ToString();//是否启用多计量单位
        if (!IsPostBack)
        {
            ddlStorage.Attributes.Add("onchange", "DoChange();");

            txtLossNo.CodingType = ConstUtil.CODING_RULE_Storage_NO;
            txtLossNo.ItemTypeID = ConstUtil.CODING_RULE_StorageLoss_NO;

            DataTable dt = CodeReasonTypeBus.GetReasonTypeByFlag(companyCD, "5");
            if (dt.Rows.Count > 0)
            {
                ddlReason.DataSource = dt;
                ddlReason.DataTextField = "CodeName";
                ddlReason.DataValueField = "ID";
                ddlReason.DataBind();
            }
            ddlReason.Items.Insert(0, new ListItem("--请选择--", ""));

            if (LossNoID != "" && LossNoID != null)
            {
                txtIndentityID.Value = LossNoID;//给隐藏域赋主键
            }
            else
            {
                this.txtCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();//制单人
                this.txtCreateDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");

                this.txtModifiedUserID.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID.ToString();//最后更新人
                this.txtModifiedDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给最后更新时间日期赋值

            }
            if (LossNoID != "" && LossNoID != null)
            {
                this.div_LossNo_uc.Attributes.Add("style", "display:none;");
                this.div_LossNo_Lable.Attributes.Add("style", "display:block;");
            }
            else
            {
                this.div_LossNo_uc.Attributes.Add("style", "display:block;");
                this.div_LossNo_Lable.Attributes.Add("style", "display:none;");
            }
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt1 = StorageBus.GetStorageListBycondition(model);
            if (dt1.Rows.Count > 0)
            {
                ddlStorage.DataSource = dt1;
                ddlStorage.DataTextField = "StorageName";
                ddlStorage.DataValueField = "ID";
                ddlStorage.DataBind();
            }

            //审批流程设置弹出层设置
            FlowApply1.BillTypeFlag = ConstUtil.BILL_TYPEFLAG_STORAGE;
            FlowApply1.BillTypeCode = ConstUtil.CODING_RULE_StorageLoss_NO;

            //模板列表模块ID
            hidModuleID.Value = Request.QueryString["ListModuleID"];
            intFromType.Value = Request.QueryString["intFromType"];
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //返回按钮可见
                btnBack.Visible = true;
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_STORAGE_STORAGELOSS_LIST, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
            }
            else
            {
                //返回按钮不可见
                btnBack.Visible = false;
            }

        }
    }
        /// <summary>
        /// 更新仓库信息
        /// </summary>
        /// <param name="model"></param>
        /// <param name="loginUserID"></param>
        /// <returns></returns>
        public static bool UpdateStorage(StorageModel model)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine(" UPDATE officedba.StorageInfo SET");
            sql.AppendLine(" StorageName      = @StorageName,");
            sql.AppendLine(" StorageType      = @StorageType,");
            sql.AppendLine(" Remark                = @Remark,");
            sql.AppendLine(" UsedStatus        = @UsedStatus,");

            sql.AppendLine(" CanViewUser                = @CanViewUser,");
            sql.AppendLine(" StorageAdmin        = @StorageAdmin   ");
            sql.AppendLine(" Where  CompanyCD=@CompanyCD and ID=@ID");



            SqlParameter[] param = new SqlParameter[8];
            param[0] = SqlHelper.GetParameter("@ID", model.ID);
            param[1] = SqlHelper.GetParameter("@StorageName", model.StorageName);
            param[2] = SqlHelper.GetParameter("@StorageType", model.StorageType);
            param[3] = SqlHelper.GetParameter("@Remark", model.Remark);
            param[4] = SqlHelper.GetParameter("@UsedStatus", model.UsedStatus);
            param[5] = SqlHelper.GetParameter("@CompanyCD", model.CompanyCD);
            param[6] = SqlHelper.GetParameter("@CanViewUser", model.CanViewUser.Trim());
            param[7] = SqlHelper.GetParameter("@StorageAdmin", model.StorageAdmin.Trim());
            SqlHelper.ExecuteTransSql(sql.ToString(), param);
            return SqlHelper.Result.OprateCount > 0 ? true : false;
        }
    /// <summary>
    /// 加载窗体
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {
        FlowApply1.BillTypeFlag = ConstUtil.BILL_TYPECODE_STORAGE_QUALITY;
        FlowApply1.BillTypeCode = ConstUtil.BILL_TYPECODE_STORAGE_QUALITYADD;
        if (Request.QueryString["From"] != null)
        {
            myFrom = Request.QueryString["From"].ToString();
        }
        if (!IsPostBack)
        {
            #region 加载基本信息
            string InNoID = Request.QueryString["InNoID"];
            int EmployeeId = UserInfo.EmployeeID;
            string userId = UserInfo.UserID;
            companyCD = UserInfo.CompanyCD;
            txtCreator.Value = EmployeeId.ToString();
            tbCreator.Text = UserInfo.EmployeeName;
            tbConfirmor.Text = UserInfo.EmployeeName;
            tbCloser.Text = UserInfo.EmployeeName;
            tbModifiedUserID.Text = userId;
            txtCloser.Value = EmployeeId.ToString();
            txtConfirmor.Value = EmployeeId.ToString();
            txtConfirmDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtModifiedUserID.Value = EmployeeId.ToString();
            txtCreateDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtModifiedDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtCloseDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            txtEnterDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            // 条目按钮是否显示
            btnGetGoods.Visible = UserInfo.IsBarCode;
            unbtnGetGoods.Visible = UserInfo.IsBarCode;

            // 多计量单位控制
            _isMoreUnit = UserInfo.IsMoreUnit;
            // 小数位数
            _selPoint = int.Parse(UserInfo.SelPoint);
            #endregion

            txtInNo.CodingType = ConstUtil.CODING_RULE_StorageQuality_NO;
            txtInNo.ItemTypeID = ConstUtil.CODING_RULE_StorageQualityCheck_NO;
            hidNoID.Value = InNoID;

            if (InNoID != "" && InNoID != null)
            {
                this.div_InNo_uc.Attributes.Add("style", "display:none;");
                this.div_InNo_Lable.Attributes.Add("style", "display:block;");
            }
            else
            {
                this.div_InNo_uc.Attributes.Add("style", "display:block;");
                this.div_InNo_Lable.Attributes.Add("style", "display:none;");
            }
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt = StorageBus.GetStorageListBycondition(model);
            if (dt.Rows.Count > 0)
            {
                ddlStorageInfo.DataSource = dt;
                ddlStorageInfo.DataTextField = "StorageName";
                ddlStorageInfo.DataValueField = "ID";
                ddlStorageInfo.DataBind();
            }

        }
    }
Beispiel #15
0
        /// <summary>
        /// 仓库插入
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool InsertStorage(StorageModel model, out int IndexIDentity)
        {
            IndexIDentity = 0;
            //获取登陆用户信息
            UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
            //设置公司代码
            model.CompanyCD = userInfo.CompanyCD;
            //定义返回变量
            bool isSucc = false;
            /* 
             * 定义日志内容变量 
             * 增删改相关的日志,需要输出操作日志,该类型日志插入到数据库
             * 其他的 如出现异常时,需要输出系统日志,该类型日志保存到日志文件
             */
            //获取公司代码
            string companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

            //执行删除操作
            try
            {
                //执行更新
                isSucc = StorageDBHelper.InsertStorage(model, out IndexIDentity);
            }
            catch (Exception ex)
            {
                //输出日志
                WriteSystemLog(userInfo, ex);
            }
            //定义变量
            string remark;
            //成功时
            if (isSucc)
            {
                //设置操作成功标识
                remark = ConstUtil.LOG_PROCESS_SUCCESS;
            }
            else
            {
                //设置操作成功标识 
                remark = ConstUtil.LOG_PROCESS_FAILED;
            }
            //操作日志
            LogInfoModel logModel = InitLogInfo(model.StorageNo);
            //涉及关键元素 这个需要根据每个页面具体设置,本页面暂时设置为空
            logModel.Element = ConstUtil.LOG_PROCESS_INSERT;
            //设置操作成功标识
            logModel.Remark = remark;

            //登陆日志
            LogDBHelper.InsertLog(logModel);
            return isSucc;

        }
Beispiel #16
0
 public static DataTable GetLitBycondition(StorageModel model, int pageIndex, int pageCount, string ord, ref int TotalCount)
 {
     return StorageDBHelper.GetLitBycondition(model, pageIndex, pageCount, ord, ref TotalCount);
 }
        /// <summary>
        /// 重载绑定库存方法
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static DataTable GetStorageTableByRed(StorageModel model)
        {
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("select ID,StorageNo,StorageName,StorageType,UsedStatus,ISNULL(Remark,'') as Remark ");
            sql.AppendLine("from officedba.StorageInfo");
            sql.AppendLine("   where CompanyCD='" + model.CompanyCD + "'");
            SqlCommand comm = new SqlCommand();
            //过滤单据:显示当前用户拥有权限查看的单据
            //添加公司代码参数
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD", model.CompanyCD));
            if (!string.IsNullOrEmpty(model.StorageNo))
            {
                sql.AppendLine("	and StorageNo like '%'+ @StorageNo +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageNo", model.StorageNo));
            }
            if (!string.IsNullOrEmpty(model.StorageName))
            {
                sql.AppendLine(" and StorageName like '%'+ @StorageName +'%'");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageName", model.StorageName));
            }

            if (!string.IsNullOrEmpty(model.StorageType))
            {
                sql.AppendLine(" and StorageType = @StorageType");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageType", model.StorageType));
            }
            if (!string.IsNullOrEmpty(model.UsedStatus))
            {
                sql.AppendLine(" and UsedStatus = @UsedStatus");
                comm.Parameters.Add(SqlHelper.GetParameterFromString("@UsedStatus", model.UsedStatus));
            }

            comm.CommandText = sql.ToString();
            return SqlHelper.ExecuteSearch(comm);
        }
        /// <summary>
        /// 添加仓库记录
        /// </summary>
        /// <returns>DataTable</returns>
        public static bool InsertStorage(StorageModel model, out int IndexIDentity)
        {
            //SQL拼写
            StringBuilder sql = new StringBuilder();
            sql.AppendLine("INSERT INTO officedba.StorageInfo");
            sql.AppendLine("	    (CompanyCD      ");
            sql.AppendLine("		,StorageNo      ");
            sql.AppendLine("		,StorageName    ");
            sql.AppendLine("		,StorageType    ");
            sql.AppendLine("		,CanViewUser         ");
            sql.AppendLine("		,StorageAdmin    ");
            sql.AppendLine("		,Remark         ");
            sql.AppendLine("		,UsedStatus)     ");
            sql.AppendLine("VALUES                  ");
            sql.AppendLine("		(@CompanyCD     ");
            sql.AppendLine("		,@StorageNo     ");
            sql.AppendLine("		,@StorageName   ");
            sql.AppendLine("		,@StorageType   ");
            sql.AppendLine("		,@CanViewUser    ");
            sql.AppendLine("		,@StorageAdmin         ");

            sql.AppendLine("		,@Remark        ");
            sql.AppendLine("		,@UsedStatus)    ");
            sql.AppendLine("set @IndexID = @@IDENTITY");


            SqlCommand comm = new SqlCommand();
            comm.CommandText = sql.ToString();
            SqlParameter IndexID = new SqlParameter("@IndexID", SqlDbType.Int);
            IndexID.Direction = ParameterDirection.Output;
            comm.Parameters.Add(IndexID);
            //设置参数
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CompanyCD ", model.CompanyCD.Trim()));//公司编码
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageNo ", model.StorageNo.Trim()));//编号
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageName ", model.StorageName.Trim()));//主题
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageType ", model.StorageType.Trim()));
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@Remark ", model.Remark.Trim()));//
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@UsedStatus ", model.UsedStatus.Trim()));//
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@CanViewUser ", model.CanViewUser.Trim()));// 
            comm.Parameters.Add(SqlHelper.GetParameterFromString("@StorageAdmin ", model.StorageAdmin.Trim()));//
            bool result = SqlHelper.ExecuteTransWithCommand(comm);
            if (result)
            {
                IndexIDentity = int.Parse(comm.Parameters["@IndexID"].Value.ToString());
            }
            else
            {
                IndexIDentity = 0;
            }
            return result;

        }
    private void BindLoad(string InNoID)
    {
        txtInNo.CodingType = ConstUtil.CODING_RULE_Storage_NO;
        txtInNo.ItemTypeID = ConstUtil.CODING_RULE_StorageIn_NO;
        if (InNoID != "" && InNoID != null)
        {
            txtIndentityID.Value = InNoID;
        }
        else
        {
            this.txtCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();//制单人
            this.txtCreateDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");

            this.txtModifiedUserID.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID.ToString();//最后更新人
            this.txtModifiedDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给最后更新时间日期赋值
            UserExecutor.Value = UserInfo.EmployeeName;
            txtExecutorID.Value = UserInfo.EmployeeID.ToString();
            txtEnterDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
        }
        if (InNoID != "" && InNoID != null)
        {
            this.div_InNo_uc.Attributes.Add("style", "display:none;");
            this.div_InNo_Lable.Attributes.Add("style", "display: ;");
        }
        else
        {
            this.div_InNo_uc.Attributes.Add("style", "display: ;");
            this.div_InNo_Lable.Attributes.Add("style", "display:none;");
        }
        StorageModel model = new StorageModel();
        model.CompanyCD = companyCD;
        model.UsedStatus = "1";
        DataTable dt = StorageBus.GetStorageListBycondition(model);
        if (dt.Rows.Count > 0)
        {
            ddlStorageInfo.DataSource = dt;
            ddlStorageInfo.DataTextField = "StorageName";
            ddlStorageInfo.DataValueField = "ID";
            ddlStorageInfo.DataBind();
        }

        //模板列表模块ID
        hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEINPURCHASE_List;
        //获取请求参数
        string requestParam = Request.QueryString.ToString();
        //通过参数个数来判断是否从菜单过来
        int firstIndex = requestParam.IndexOf("&");
        //从列表过来时
        if (firstIndex > 0)
        {
            //返回按钮可见
            btnBack.Visible = true;
            //获取列表的查询条件
            string searchCondition = requestParam.Substring(firstIndex);
            //去除参数
            searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_STORAGE_STORAGEINPURCHASE_List, string.Empty);
            //设置检索条件
            hidSearchCondition.Value = searchCondition;
        }
        else
        {
            //返回按钮不可见
            btnBack.Visible = false;
        }
    }
 private void BindStorage()
 {
     StorageModel StorageM = new StorageModel();
     StorageM.CompanyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;
     StorageM.UsedStatus = "1";
     StorageHid.DataSource = StorageBus.GetStorageListBycondition(StorageM);
     StorageHid.DataValueField = "ID";
     StorageHid.DataTextField = "StorageName";
     StorageHid.DataBind();
     StorageHid.Items.Insert(0,new ListItem("--请选择--",""));
 }
 /// <summary>
 /// 绑定所有下拉框
 /// </summary>
 private void BindCom()
 {
     TypeFlag = "5";
     Code = "2";
     DataTable dt = null;
     dt = CodePublicTypeBus.GetCodePublicByCode(TypeFlag, Code);//绑定等级
     if (dt.Rows.Count > 0)
     {
         this.sel_GradeID.DataTextField = "TypeName";
         sel_GradeID.DataValueField = "ID";
         sel_GradeID.DataSource = dt;
         sel_GradeID.DataBind();
     }
     sel_GradeID.Items.Insert(0, new ListItem("--请选择--", "0"));
     Code = "1";
     dt = CodePublicTypeBus.GetCodePublicByCode(TypeFlag, Code);//绑定品牌
     if (dt.Rows.Count > 0)
     {
         this.sel_Brand.DataTextField = "TypeName";
         sel_Brand.DataValueField = "ID";
         sel_Brand.DataSource = dt;
         sel_Brand.DataBind();
     }
     sel_Brand.Items.Insert(0, new ListItem("--请选择--", "0"));
     Code = "3";
     dt = CodePublicTypeBus.GetCodePublicByCode(TypeFlag, Code);//绑定颜色
     if (dt.Rows.Count > 0)
     {
         this.sel_ColorID.DataTextField = "TypeName";
         sel_ColorID.DataValueField = "ID";
         sel_ColorID.DataSource = dt;
         sel_ColorID.DataBind();
     }
     sel_ColorID.Items.Insert(0, new ListItem("--请选择--", "0"));
     dt = CodeReasonFeeBus.GetCodeUnitType();//绑定单位
     if (dt.Rows.Count > 0)
     {
         this.sel_UnitID.DataTextField = "CodeName";
         sel_UnitID.DataValueField = "ID";
         sel_UnitID.DataSource = dt;
         sel_UnitID.DataBind();
     }
     Code = "5";
     dt = CodePublicTypeBus.GetCodePublicByCode(TypeFlag, Code);//绑定材质
     if (dt.Rows.Count > 0)
     {
         this.sel_Material.DataTextField = "TypeName";
         sel_Material.DataValueField = "ID";
         sel_Material.DataSource = dt;
         sel_Material.DataBind();
     }
     sel_Material.Items.Insert(0, new ListItem("--请选择--", "0"));
     StorageModel model = new StorageModel();
     UserInfoUtil userInfo = (UserInfoUtil)SessionUtil.Session["UserInfo"];
     model.CompanyCD = userInfo.CompanyCD;
     DataTable dt_Stor = StorageBus.GetStorageListBycondition(model);//绑定仓库
     if (dt_Stor.Rows.Count > 0)
     {
         sel_StorageID.DataSource = dt_Stor;
         sel_StorageID.DataTextField = "StorageName";
         sel_StorageID.DataValueField = "ID";
         sel_StorageID.DataBind();
     }
     //DataTable dt_BindUnit =new DataTable();
     //dt_BindUnit = ProductInfoBus.GetUnitGroupList(this.txtUnitGroup.Value);
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        string InNoID = Request.QueryString["InNoID"];
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;

        hidZero.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsZero.ToString();

        //是否启用批次
        //BatchRuleControl1.CodingType = ConstUtil.CODING_RULE_TYPE_ZERO;
        //BatchRuleControl1.ItemTypeID = ConstUtil.CODING_RULE_BATCH_NO;


        //启用小数位数,默认2位
        hidSelPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;

        //是否启用单位组
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            hidMoreUnit.Value = "true";
            tdDanWei.Attributes.Add("style", "display:block;");
            tdDanWei.Attributes.Add("style", "width: 8%");
            tdShuLiang.Attributes.Add("style", "display:block;");
            tdShuLiang.Attributes.Add("style", "width: 8%");
            divSpan.Attributes.Add("style", "display:block;");
            divRedSpan.Attributes.Add("style", "display:none;");
            divJiBendw.Attributes.Add("style", "display:block;");
            divDanWei.Attributes.Add("style", "display:none;");
        }
        else
        {
            hidMoreUnit.Value = "false";
            tdDanWei.Attributes.Add("style", "display:none;");
            tdShuLiang.Attributes.Add("style", "display:none;");
            divSpan.Attributes.Add("style", "display:none;");
            divRedSpan.Attributes.Add("style", "display:block;");
            divJiBendw.Attributes.Add("style", "display:none;");
            divDanWei.Attributes.Add("style", "display:block;");
        }

        if (!IsPostBack)
        {
            DataTable dtReason = CodeReasonTypeBus.GetReasonType(companyCD);
            if (dtReason.Rows.Count > 0)
            {
                ddlReasonType.DataSource = dtReason;
                ddlReasonType.DataTextField = "CodeName";
                ddlReasonType.DataValueField = "ID";
                ddlReasonType.DataBind();
            }
            ddlReasonType.Items.Insert(0, new ListItem("--请选择--", ""));


            ddlFromType.Attributes.Add("onchange", "DoChange();");

            txtInNo.CodingType = ConstUtil.CODING_RULE_Storage_NO;
            txtInNo.ItemTypeID = ConstUtil.CODING_RULE_StorageIn_NO;
            if (InNoID != "" && InNoID != null)
            {
                txtIndentityID.Value = InNoID;//给隐藏域赋主键
            }
            else
            {
                this.txtCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();//制单人
                this.txtCreateDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");

                this.txtModifiedUserID.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID.ToString();//最后更新人
                this.txtModifiedDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给最后更新时间日期赋值
                UserExecutor.Value = UserInfo.EmployeeName;
                txtExecutorID.Value = UserInfo.EmployeeID.ToString();
                txtEnterDate.Text = DateTime.Now.ToString("yyyy-MM-dd");
            }
            if (InNoID != "" && InNoID != null)
            {
                this.div_InNo_uc.Attributes.Add("style", "display:none;");
                this.div_InNo_Lable.Attributes.Add("style", "display:;");
            }
            else
            {
                this.div_InNo_uc.Attributes.Add("style", "display:;");
                this.div_InNo_Lable.Attributes.Add("style", "display:none;");
            }
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt = StorageBus.GetStorageListByRed(model);
            if (dt.Rows.Count > 0)
            {
                ddlStorageInfo.DataSource = dt;
                ddlStorageInfo.DataTextField = "StorageName";
                ddlStorageInfo.DataValueField = "ID";
                ddlStorageInfo.DataBind();
            }

            //模板列表模块ID
            hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEINRED_LIST;
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //返回按钮可见
                btnBack.Visible = true;
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_STORAGE_STORAGEINRED_LIST, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
            }
            else
            {
                //返回按钮不可见
                btnBack.Visible = false;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        companyCD = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).CompanyCD;//[待修改]

        //明细单价是否允许为0
        hidZero.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsZero.ToString();

        //是否启用单位组
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsMoreUnit)
        {
            hidMoreUnit.Value = "true";
            tdDanWei.Attributes.Add("style", "display:block;");
            tdDanWei.Attributes.Add("style", "width: 8%");
            tdShuLiang.Attributes.Add("style", "display:block;");
            tdShuLiang.Attributes.Add("style", "width: 8%");
            divSpan.Attributes.Add("style", "display:block;");
            divRedSpan.Attributes.Add("style", "display:none;");
            divJiBendw.Attributes.Add("style", "display:block;");
            divDanWei.Attributes.Add("style", "display:none;");
        }
        else
        {
            hidMoreUnit.Value = "false";
            tdDanWei.Attributes.Add("style", "display:none;");
            tdShuLiang.Attributes.Add("style", "display:none;");
            divSpan.Attributes.Add("style", "display:none;");
            divRedSpan.Attributes.Add("style", "display:block;");
            divJiBendw.Attributes.Add("style", "display:none;");
            divDanWei.Attributes.Add("style", "display:block;");
        }

        //启用小数位数,默认2位
        hidSelPoint.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).SelPoint;        

        BatchRuleControl1.CodingType = ConstUtil.CODING_RULE_TYPE_ZERO;
        BatchRuleControl1.ItemTypeID = ConstUtil.CODING_RULE_BATCH_NO;
       
        //设置隐藏域条码的值
        if (((UserInfoUtil)SessionUtil.Session["UserInfo"]).IsBarCode)
        {
            hidCodeBar.Value = "1";
        }
        else
        {
            hidCodeBar.Value = "0";
        }
        if (!IsPostBack)
        {
            /*------------------ Start 是否可以使用期初录入模块-------------------------------*/
            //bool ifedit = StorageInitailBus.ISADD(companyCD);
            //if (ifedit == true)
            //{
            Hid_ifEdit.Value = "1";//可以
            //}
            //else
            //{
            //    Hid_ifEdit.Value = "0";//不能使用了
            //}
            /*------------------ End 是否可以使用期初录入模块-------------------------------*/

            string InNoID = Request.QueryString["InNoID"];
            txtInNo.CodingType = ConstUtil.CODING_RULE_Storage_NO;
            txtInNo.ItemTypeID = ConstUtil.CODING_RULE_StorageIn_NO;
            if (InNoID != "" && InNoID != null)
            {
                txtIndentityID.Value = InNoID;//给隐藏域赋主键
            }
            if (InNoID != "" && InNoID != null)//更新
            {
                this.div_InNo_uc.Attributes.Add("style", "display:none;");
                this.div_InNo_Lable.Attributes.Add("style", "display:block;");
            }
            else//新建
            {
                this.txtCreator.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeName.ToString();//制单人
                this.txtCreateDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给那个制单日期赋值
                this.HiddCreator.Value = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).EmployeeID.ToString();
                this.txtModifiedUserID.Text = ((UserInfoUtil)SessionUtil.Session["UserInfo"]).UserID.ToString();//最后更新人
                this.txtModifiedDate.Text = System.DateTime.Now.ToString("yyyy-MM-dd");//新建的时候给最后更新时间日期赋值

                this.div_InNo_uc.Attributes.Add("style", "display:block;");
                this.div_InNo_Lable.Attributes.Add("style", "display:none;");
            }
            //仓库获取
            StorageModel model = new StorageModel();
            model.CompanyCD = companyCD;
            model.UsedStatus = "1";
            DataTable dt = StorageBus.GetStorageListBycondition(model);
            if (dt.Rows.Count > 0)
            {
                sltStorageID.DataSource = dt;
                sltStorageID.DataTextField = "StorageName";
                sltStorageID.DataValueField = "ID";
                sltStorageID.DataBind();

            }
            //模板列表模块ID
            hidModuleID.Value = ConstUtil.MODULE_ID_STORAGE_STORAGEINITAIL_LIST;
            //获取请求参数
            string requestParam = Request.QueryString.ToString();
            //通过参数个数来判断是否从菜单过来
            int firstIndex = requestParam.IndexOf("&");
            //从列表过来时
            if (firstIndex > 0)
            {
                //返回按钮可见
                btnBack.Visible = true;
                //获取列表的查询条件
                string searchCondition = requestParam.Substring(firstIndex);
                //去除参数
                searchCondition = searchCondition.Replace("&ModuleID=" + ConstUtil.MODULE_ID_STORAGE_STORAGEINITAIL_LIST, string.Empty);
                //设置检索条件
                hidSearchCondition.Value = searchCondition;
            }
            else
            {
                //返回按钮不可见
                btnBack.Visible = false;
            }
        }

    }