private void InitializeCustomControls()
        {
            InitToolBar();

            btnQualified        = GetControltByMaster("btnQualified") as Button;
            btnQualified.Click += new EventHandler(btnQualified_Click);

            btnReject        = GetControltByMaster("btnReject") as Button;
            btnReject.Click += new EventHandler(btnReject_Click);

            btnOK               = (Button)GetControltByMaster("btnOK");
            btnOK.Click        += new EventHandler(btnOK_Click);
            btnOK.OnClientClick = "return VerifyBtn()";
            (GetControltByMaster("ltrJS") as Literal).Text = JSDialogAid.GetVerifyBtnJS();

            BoundField bfColumn;

            //初始化spgvQualifiedMaterial
            this.spgvQualifiedMaterial = new SPGridView();
            this.spgvQualifiedMaterial.AutoGenerateColumns = false;
            this.spgvQualifiedMaterial.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
            this.spgvQualifiedMaterial.RowDataBound += new GridViewRowEventHandler(spgvMaterial_RowDataBound);

            foreach (var kvp in ShowTlist)
            {
                bfColumn            = new BoundField();
                bfColumn.HeaderText = kvp.Split(':')[0];
                bfColumn.DataField  = kvp.Split(':')[1];
                if (bfColumn.HeaderText.Equals("StorageID"))
                {
                    break;
                }
                this.spgvQualifiedMaterial.Columns.Add(bfColumn);
            }
            (this.spgvQualifiedMaterial.Columns[3] as BoundField).DataField = "QualifiedGentaojian";

            //初始化spgvRejectMaterial
            this.spgvRejectMaterial = new SPGridView();
            this.spgvRejectMaterial.AutoGenerateColumns = false;
            this.spgvRejectMaterial.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
            this.spgvRejectMaterial.RowDataBound += new GridViewRowEventHandler(spgvMaterial_RowDataBound);

            foreach (var kvp in ShowTlist)
            {
                bfColumn            = new BoundField();
                bfColumn.HeaderText = kvp.Split(':')[0];
                bfColumn.DataField  = kvp.Split(':')[1];
                this.spgvRejectMaterial.Columns.Add(bfColumn);
            }
            spgvRejectMaterial.Columns[3].HeaderText = "待报废数量";
            (this.spgvRejectMaterial.Columns[3] as BoundField).DataField = "RejectGentaojian";

            //加入上传质检报告号列
            HyperLinkField hlfReport = new HyperLinkField();

            hlfReport.HeaderText = "上传质检报告";

            this.spgvQualifiedMaterial.Columns.Insert(5, hlfReport);
            this.spgvRejectMaterial.Columns.Insert(5, hlfReport);
        }
Example #2
0
        private void InitializeCustomControl()
        {
            InitBar();

            this.ddlProprietor = GetControltByMaster("ddlProprietor") as DropDownList;
            this.ddlProprietor.SelectedIndexChanged += new EventHandler(ddlProprietor_SelectedIndexChanged);

            this.ddlConstructor = GetControltByMaster("ddlConstructor") as DropDownList;

            this.ddlProject = GetControltByMaster("ddlProject") as DropDownList;
            this.ddlProject.SelectedIndexChanged += new EventHandler(ddlProject_SelectedIndexChanged);

            this.ddlProjectStage = GetControltByMaster("ddlProjectStage") as DropDownList;

            this.txtProperty = GetControltByMaster("txtProperty") as TextBox;

            this.btnSave        = GetControltByMaster("btnSave") as Button;
            this.btnSave.Click += new EventHandler(btnSave_Click);

            this.txtNoticeCode = GetControltByMaster("txtNoticeCode") as TextBox;
            this.txtRemark     = GetControltByMaster("txtRemark") as TextBox;

            this.dtcCreateTime = GetControltByMaster("dtcCreateTime") as DateTimeControl;

            vldNoticeCode = GetControltByMaster("vldNoticeCode") as CustomValidator;
            vldNoticeCode.ClientValidationFunction = "vldDDL";
            vldNoticeCode.ServerValidate          += new ServerValidateEventHandler(vldNoticeCode_ServerValidate);

            (GetControltByMaster("ltrJS") as Literal).Text = JSDialogAid.GetVerifyDDLJSForVld("--请选择--", "您填入的信息不完整,请核实后重新提交!");
        }
Example #3
0
        private void InitializeCustomControls()
        {
            //初始化ToolBar
            InitToolBar();

            //初始化spgvMaterial
            this.spgvMaterial = new SPGridView();
            this.spgvMaterial.AutoGenerateColumns = false;
            this.spgvMaterial.Attributes.Add("style", "word-break:keep-all;word-wrap:normal");
            this.spgvMaterial.RowDataBound += new GridViewRowEventHandler(spgvMaterial_RowDataBound);

            BoundField bfColumn;

            foreach (var kvp in ShowTlist)
            {
                bfColumn            = new BoundField();
                bfColumn.HeaderText = kvp.Split(':')[0];
                bfColumn.DataField  = kvp.Split(':')[1];
                this.spgvMaterial.Columns.Add(bfColumn);
            }

            //加入仓库列
            TemplateField tfStorage = new TemplateField();

            tfStorage.HeaderText   = "仓库";
            tfStorage.ItemTemplate = new MulDropDownListTemplate(DataControlRowType.DataRow, "DDLStorage");
            this.spgvMaterial.Columns.Insert(6, tfStorage);

            //加入垛位列
            TemplateField tfPile = new TemplateField();

            tfPile.HeaderText   = "垛位";
            tfPile.ItemTemplate = new MulDropDownListTemplate(DataControlRowType.DataRow, "DDLPile");
            this.spgvMaterial.Columns.Insert(7, tfPile);

            //加入备注列
            TemplateField tfRemark = new TemplateField();

            tfRemark.HeaderText   = "备注";
            tfRemark.ItemTemplate = new TextBoxTemplate("备注", DataControlRowType.DataRow, "Remark");
            this.spgvMaterial.Columns.Insert(9, tfRemark);

            btnOK               = (Button)GetControltByMaster("btnOK");
            btnOK.Click        += new EventHandler(btnOK_Click);
            btnOK.OnClientClick = "return VerifyDDL()";
            (GetControltByMaster("ltrJS") as Literal).Text = JSDialogAid.GetVerifyDDLJSForBtn("--请选择--", "请为物资选择要存放的仓库或垛位!");

            chbCheck = (CheckBox)GetControltByMaster("chbCheck");
            chbCheck.CheckedChanged += new EventHandler(chbCheck_CheckedChanged);

            lblProblem = (Label)GetControltByMaster("lblProblem");
            txtProblem = (TextBox)GetControltByMaster("txtProblem");
        }
Example #4
0
        private void InitToolBar()
        {
            //添加按钮到toolbar
            ToolBar tbarTop = (ToolBar)GetControltByMaster("tbarbusiness");
            //新建
            ToolBarButton tbarbtnAdd = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnAdd.ID       = "AddNewRow";
            tbarbtnAdd.Text     = "新建";
            tbarbtnAdd.ImageUrl = "/_layouts/images/newitem.gif";
            tbarbtnAdd.Click   += new EventHandler(tbarbtnAdd_Click);
            tbarTop.Buttons.Controls.Add(tbarbtnAdd);


            //删除
            ToolBarButton tbarbtnDelete = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnDelete.ID       = "DeleteRow";
            tbarbtnDelete.Text     = "删除";
            tbarbtnDelete.ImageUrl = "/_layouts/images/delete.gif";
            tbarbtnDelete.Click   += new EventHandler(tbarbtnDelete_Click);
            StringBuilder sbScript = new StringBuilder();

            sbScript.Append("var aa= window.confirm('确认删除所选项?');");
            sbScript.Append("if(aa == false){");
            sbScript.Append("return false;}");
            tbarbtnDelete.OnClientClick = sbScript.ToString();
            tbarTop.Buttons.Controls.Add(tbarbtnDelete);

            //返回
            ToolBarButton tbarbtnBack = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            tbarbtnBack.ID            = "backRow";
            tbarbtnBack.Text          = "确认并返回";
            tbarbtnBack.ImageUrl      = "/_layouts/images/BACK.GIF";
            tbarbtnBack.Click        += new EventHandler(tbarbtnBack_Click);
            tbarbtnBack.OnClientClick = "return VerifyDDL()";
            (GetControltByMaster("ltrJS") as Literal).Text = JSDialogAid.GetVerifyDDLJSForBtn("--请选择--", "请为维修保养的物资选择生产厂商!");
            tbarTop.Buttons.Controls.Add(tbarbtnBack);


            ToolBarButton btnRefresh = (ToolBarButton)this.Page.LoadControl("~/_controltemplates/ToolBarButton.ascx");

            btnRefresh.ID       = "btnRefresh";
            btnRefresh.Text     = "刷新";
            btnRefresh.ImageUrl = "/_layouts/images/refresh.GIF";
            btnRefresh.Padding  = "0,5,0,0";
            btnRefresh.Click   += new EventHandler(btnRefresh_Click);
            tbarTop.RightButtons.Controls.Add(btnRefresh);
        }
Example #5
0
 private void ShowCustomControls()
 {
     if (string.IsNullOrEmpty(_receivers))
     {
         ltrJS.Text = JSDialogAid.GetUsersJS(txtReceivers.ClientID);
     }
     else//已经选定接收者
     {
         chbPublic.Enabled     = false;
         txtReceivers.ReadOnly = true;
         txtReceivers.Text     = _receivers;
         ltrJS.Text            = string.Empty;
     }
 }
Example #6
0
 void chbPublic_CheckedChanged(object sender, EventArgs e)
 {
     if (chbPublic.Checked)
     {
         txtReceivers.Text    = "全部人员";
         txtReceivers.Enabled = false;
         ltrJS.Text           = string.Empty;
     }
     else
     {
         txtReceivers.Text    = string.Empty;
         txtReceivers.Enabled = true;
         ltrJS.Text           = JSDialogAid.GetUsersJS(txtReceivers.ClientID);
     }
 }
Example #7
0
        private void InitControl()
        {
            InitBar();

            this.ddlProject = (DropDownList)GetControltByMaster("ddlProject");
            this.ddlCompany = (DropDownList)GetControltByMaster("ddlCompany");
            this.ddlCompany.SelectedIndexChanged += new EventHandler(ddlCompany_SelectedIndexChanged);
            this.dtcCreateTime  = GetControltByMaster("dtcCreateTime") as DateTimeControl;
            this.btnSave        = (Button)GetControltByMaster("btnSave");
            this.btnSave.Click += new EventHandler(btnSave_Click);

            this.txtTaker = (TextBox)GetControltByMaster("txtTaker");
            ((Literal)GetControltByMaster("ltrTaker")).Text = JSDialogAid.GetJSForDialog(txtTaker.ClientID, "../StorageAndPile/SelectUser.aspx");

            this.txtRemark = (TextBox)GetControltByMaster("txtRemark");
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            txtStorageEmp = (TextBox)GetControltByMaster("txtStorageEmp");
            L1            = (Literal)GetControltByMaster("L1");
            L1.Text       = JSDialogAid.GetJSForDialog(txtStorageEmp.ClientID, "SelectUser.aspx");
            InitControls();
            if (!IsPostBack)
            {
                InitData();
            }


            btnEdit                    = (Button)GetControltByMaster("btnEdit");
            btnEdit.Click             += new EventHandler(btnEdit_Click);
            btnCancel                  = (Button)GetControltByMaster("btnCancel");
            btnCancel.Click           += new EventHandler(btnCancel_Click);
            btnCancel.CausesValidation = false;
        }
Example #9
0
        private void InitializeCustomControls()
        {
            InitBar();

            ((Label)GetControltByMaster("lblCreater")).Text = SPContext.Current.Web.CurrentUser.LoginName;
            txtContent                = (TextBox)GetControltByMaster("txtContent");
            txtTitle                  = (TextBox)GetControltByMaster("txtTitle");
            txtReceivers              = (TextBox)GetControltByMaster("txtReceivers");
            btnOK                     = (Button)GetControltByMaster("btnOK");
            btnOK.Click              += new EventHandler(btnOK_Click);
            chbPublic                 = (CheckBox)GetControltByMaster("chbPublic");
            chbPublic.CheckedChanged += new EventHandler(chbPublic_CheckedChanged);
            ltrJS                     = (Literal)GetControltByMaster("ltrJS");
            chbAttach                 = (CheckBox)GetControltByMaster("chbAttach");
            chbAttach.CheckedChanged += new EventHandler(chbAttach_CheckedChanged);
            ltrJS.Text                = JSDialogAid.GetUsersJS(txtReceivers.ClientID);

            txtContent.Text = Request.QueryString["MessageInfo"];
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            txtStorageEmp = (TextBox)GetControltByMaster("txtStorageEmp");
            //StringBuilder sb = new StringBuilder();
            //sb.Append("<script type=\"text/javascript\">");
            //sb.Append("function OpenDialogSelectUser()");
            //sb.Append("{");
            //sb.Append("var uuu=window.showModalDialog('SelectUser.aspx','0','dialogWidth:300px;dialogHeight:450px');");
            //sb.Append("document.getElementById('" +txtStorageEmp.ClientID + "').value=\"baibei\\\\\"+uuu;");
            //sb.Append("}");
            //sb.Append("</script>");
            L1      = (Literal)GetControltByMaster("L1");
            L1.Text = JSDialogAid.GetJSForDialog(txtStorageEmp.ClientID, "SelectUser.aspx");

            btnCreate                  = (Button)GetControltByMaster("btnCreate");
            btnCreate.Click           += new EventHandler(btnCreate_Click);
            btnCancel                  = (Button)GetControltByMaster("btnCancel");
            btnCancel.Click           += new EventHandler(btnCancel_Click);
            btnCancel.CausesValidation = false;
        }
        private void InitControl()
        {
            InitBar();

            this.lblCreatorName  = GetControltByMaster("lblCreatorName") as Label;
            this.lblExecutorName = GetControltByMaster("lblExecutorName") as Label;
            this.btnSave         = (Button)GetControltByMaster("btnSave");
            this.btnSave.Click  += new EventHandler(btnSave_Click);

            using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString))
            {
                //初始化调拨通知单号
                (this.GetControltByMaster("lblNoticeCode") as Label).Text = db.StorageOutNotice.SingleOrDefault(u => u.StorageOutNoticeID == _noticeid).StorageOutNoticeCode;
            }

            //根据任务类型,设置页面显示元素
            switch (_tasktype)
            {
            case "物资出库审核":
                lblCreatorName.Text  = "资产管理员";
                lblExecutorName.Text = "资产组长";
                this.strBackUrl      = string.Format("NormalOutAssetDetailsMessage.aspx?TaskID={0}", _taskid);
                break;

            case "物资调拨审核":
                lblCreatorName.Text  = "生产技术员";
                lblExecutorName.Text = "生产组长";
                if (_taskid == -1)    //分支流程--没有任务的情况
                {
                    this.strBackUrl   = "ManageStorageOutNotice.aspx";
                    this.strFinishUrl = this.strBackUrl;
                }
                else
                {
                    this.strBackUrl = string.Format("NormalOutProduceDetailsMessage.aspx?TaskID={0}", _taskid);
                }
                break;

            case "物资调拨审核信息":
                lblCreatorName.Text  = "生产组长";
                lblExecutorName.Text = "生产技术员";
                this.strBackUrl      = string.Format("NormalOutProduceAuditMessage.aspx?TaskID={0}", _taskid);
                break;

            case "物资出库审核信息":
                lblCreatorName.Text  = "资产组长";
                lblExecutorName.Text = "资产管理员";
                this.strBackUrl      = string.Format("NormalOutAssetAuditMessage.aspx?TaskID={0}", _taskid);
                break;

            case "物资出库":
                lblCreatorName.Text  = "生产技术员";
                lblExecutorName.Text = "资产管理员";
                this.strBackUrl      = string.Format("NormalOutProduceAuditMessage.aspx?TaskID={0}", this._taskid);
                break;

            case "主任审批":
                lblCreatorName.Text  = "物资管理员";
                lblExecutorName.Text = "主任";
                this.strBackUrl      = string.Format("NormalOutAssetAuditInfo.aspx?TaskID={0}", _taskid);
                break;
            }

            (GetControltByMaster("lblCreator") as Label).Text = SPContext.Current.Web.CurrentUser.LoginName;

            txtExecutor = GetControltByMaster("txtExecutor") as TextBox;
            //初始化选择用户脚本
            if (string.IsNullOrEmpty(_executor))
            {
                (GetControltByMaster("ltrJS") as Literal).Text = JSDialogAid.GetJSForDialog(txtExecutor.ClientID, "../StorageAndPile/SelectUser.aspx");
            }
            else
            {
                txtExecutor.Text     = _executor;
                txtExecutor.ReadOnly = true;
            }
        }
 private void selUser(TextBox tbox_W)
 {
     L1      = (Literal)GetControltByMaster("L1");
     L1.Text = JSDialogAid.GetJSForDialog(tbox_W.ClientID, "../StorageAndPile/SelectUser.aspx");
 }
Example #13
0
 private void SelectUser(ListBox users)
 {
     JSDialogAid.GetJSForDialog(users.ClientID, "../PublicPage/SelectUsers.aspx");
 }
Example #14
0
 /// <summary>
 /// 接受模式窗体返回数据
 /// </summary>
 /// <param name="tb">textbox对象</param>
 /// <param name="lb">lable对象</param>
 /// <param name="url">url</param>
 private void selectMat(TextBox tb, TextBox txtid, string url)
 {
     L4      = (Literal)GetControltByMaster("L4");
     L4.Text = JSDialogAid.GetMat(tb.ClientID, txtid.ClientID, url);
 }
Example #15
0
 /// <summary>
 /// 接受模式窗体返回数据
 /// </summary>
 /// <param name="tb">textbox对象</param>
 /// <param name="lb">lable对象</param>
 /// <param name="url">url</param>
 private void selectUser(TextBox tb, TextBox txtid, TextBox tmod, TextBox tfid, string url)
 {
     L3      = (Literal)GetControltByMaster("L3");
     L3.Text = JSDialogAid.GetDialogInfo(tb.ClientID, txtid.ClientID, tmod.ClientID, tfid.ClientID, url);
 }
Example #16
0
 /// <summary>
 /// 接受模式窗体返回数据
 /// </summary>
 /// <param name="tb">textbox对象</param>
 /// <param name="lb">lable对象</param>
 /// <param name="url">url</param>
 private void selectCommitMaterial(TextBox Material, TextBox txtcommitID, string url)
 {
     L2      = (Literal)GetControltByMaster("L2");
     L2.Text = JSDialogAid.GetDialogInfo(Material.ClientID, txtcommitID.ClientID, url);
 }
Example #17
0
 /// <summary>
 /// 接受模式窗体返回数据
 /// </summary>
 /// <param name="tb">textbox对象</param>
 /// <param name="lb">lable对象</param>
 /// <param name="url">url</param>
 private void selectUser(TextBox TM, TextBox Tid, TextBox TT, string url)
 {
     L2      = (Literal)GetControltByMaster("L2");
     L2.Text = JSDialogAid.GetMaterialInfo(TM.ClientID, Tid.ClientID, TT.ClientID, url);
 }
 /// <summary>
 /// 接受模式窗体返回数据
 /// </summary>
 /// <param name="tb">textbox对象</param>
 /// <param name="lb">lable对象</param>
 /// <param name="url">url</param>
 private void showResoult(int StorageInID, string url)
 {
     backScript      = (Literal)GetControltByMaster("backScript");
     backScript.Text = JSDialogAid.UploadData(StorageInID, url);
 }