コード例 #1
0
ファイル: ApplicationOther.cs プロジェクト: dalinhuang/labms
        public List<ExtendModule.ApplicationOther> GetModelList2(string strWhere)
        {
            string strSql = "select distinct  ProjectApp.* ,Lab_Name,State.Name as State_Name,ConType.Name as ConType_Name,LabType.Name as LabType_Name,"
                          + " Position.Name as PositionName ,Conclusion.Name as Conclusion "
                          + " from ProjectApp left join Lab on ProjectApp.LabID=Lab.ID "
                          + " left join Dictionary as State on App_State=State.Code "
                          + " left join Dictionary as ConType on App_ConstructionType=ConType.Code "
                          + " left join Dictionary as LabType on LabType.Code=App_LabType "
                          + " left join Dictionary as Position on App_Positions=Position.Code "
                          + " left join Dictionary as Conclusion on Conclusion.Code=App_ArgumentConclusion "
                          + " left join Attachment as Attach on Attach.ID=ProjectApp.App_Attachment "
                          + " left join AttachmentItem as Item on Item.Attach_ID = Attach.ID ";

            if (!string.IsNullOrEmpty(strWhere))
            {
                strSql += " where ";
                strSql += strWhere;
            }

            DataSet ds = DbHelperSQL.Query(strSql);
            List<ExtendModule.ApplicationOther> modelList = new List<ExtendModule.ApplicationOther>();

            if (ds.Tables[0].Rows.Count != 0)
            {
                ExtendModule.ApplicationOther model;
                for (int n = 0; n < ds.Tables[0].Rows.Count; n++)
                {
                    model = new ExtendModule.ApplicationOther();
                    if (ds.Tables[0].Rows[n]["ID"].ToString() != "")
                    {
                        model.ID = int.Parse(ds.Tables[0].Rows[n]["ID"].ToString());
                    }
                    model.App_Code = ds.Tables[0].Rows[n]["App_Code"].ToString();
                    model.App_ProjectCode = ds.Tables[0].Rows[n]["App_ProjectCode"].ToString();
                    if (ds.Tables[0].Rows[n]["LabID"].ToString() != "")
                    {
                        model.LabID = int.Parse(ds.Tables[0].Rows[n]["LabID"].ToString());
                    }
                    model.App_LabType = ds.Tables[0].Rows[n]["App_LabType"].ToString();
                    model.App_ConstructionType = ds.Tables[0].Rows[n]["App_ConstructionType"].ToString();
                    if (ds.Tables[0].Rows[n]["App_AppTime"].ToString() != "")
                    {
                        model.App_AppTime = DateTime.Parse(ds.Tables[0].Rows[n]["App_AppTime"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["App_CompletionTime"].ToString() != "")
                    {
                        model.App_CompletionTime = DateTime.Parse(ds.Tables[0].Rows[n]["App_CompletionTime"].ToString());
                    }
                    model.App_InCharge = ds.Tables[0].Rows[n]["App_InCharge"].ToString();
                    model.App_Phone = ds.Tables[0].Rows[n]["App_Phone"].ToString();
                    model.App_Positions = ds.Tables[0].Rows[n]["App_Positions"].ToString();
                    if (ds.Tables[0].Rows[n]["App_ApplyFinancing"].ToString() != "")
                    {
                        model.App_ApplyFinancing = int.Parse(ds.Tables[0].Rows[n]["App_ApplyFinancing"].ToString());
                    }
                    if (ds.Tables[0].Rows[n]["App_ApproveFinancing"].ToString() != "")
                    {
                        model.App_ApproveFinancing = int.Parse(ds.Tables[0].Rows[n]["App_ApproveFinancing"].ToString());
                    }
                    model.App_State = ds.Tables[0].Rows[n]["App_State"].ToString();
                    model.App_Location = ds.Tables[0].Rows[n]["App_Location"].ToString();
                    model.App_InstallCondition = ds.Tables[0].Rows[n]["App_InstallCondition"].ToString();
                    if (ds.Tables[0].Rows[n]["App_Attachment"].ToString() != "")
                    {
                        model.App_Attachment = int.Parse(ds.Tables[0].Rows[n]["App_Attachment"].ToString());
                    }
                    else
                    {
                        model.App_Attachment = 0;
                    }
                    model.App_Necessity = ds.Tables[0].Rows[n]["App_Necessity"].ToString();
                    model.App_AcceptSummary = ds.Tables[0].Rows[n]["App_AcceptSummary"].ToString();
                    if (ds.Tables[0].Rows[n]["App_AcceptanceTime"].ToString() != "")
                    {
                        model.App_AcceptanceTime = DateTime.Parse(ds.Tables[0].Rows[n]["App_AcceptanceTime"].ToString());
                    }
                    model.App_TaskSummary = ds.Tables[0].Rows[n]["App_TaskSummary"].ToString();
                    if (ds.Tables[0].Rows[n]["App_TaskTime"].ToString() != "")
                    {
                        model.App_TaskTime = DateTime.Parse(ds.Tables[0].Rows[n]["App_TaskTime"].ToString());
                    }
                    model.App_ArgumentView = ds.Tables[0].Rows[n]["App_ArgumentView"].ToString();
                    model.App_ArgumentConclusion = ds.Tables[0].Rows[n]["App_ArgumentConclusion"].ToString();
                    model.App_ExamineView = ds.Tables[0].Rows[n]["App_ExamineView"].ToString();

                    /////
                    model.Lab_Name = ds.Tables[0].Rows[n]["Lab_Name"].ToString();
                    model.State_Name = ds.Tables[0].Rows[n]["State_Name"].ToString();
                    model.ConType_Name = ds.Tables[0].Rows[n]["ConType_Name"].ToString();
                    model.LabType_Name = ds.Tables[0].Rows[n]["LabType_Name"].ToString();
                    model.Conclusion = ds.Tables[0].Rows[n]["Conclusion"].ToString();
                    model.PositionName = ds.Tables[0].Rows[n]["PositionName"].ToString();

                    modelList.Add(model);
                }

            }
            return modelList;
        }
コード例 #2
0
ファイル: AppPreview.aspx.cs プロジェクト: dalinhuang/labms
        protected void DataBinds()
        {
            int QueryID = 0;
            if (int.TryParse(Request.QueryString["ID"].ToString(), out QueryID))
            {
                if (HFQueryString != QueryID)
                {
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>window.location.href='err.aspx?Message=��ѯ�ַ�������'</script>'");
                    return;
                }
                ExtendBLL.ApplicationOther Application = new ExtendBLL.ApplicationOther();
                ExtendModule.ApplicationOther model = new ExtendModule.ApplicationOther();
                try
                {
                    model = Application.GetModelList2("ProjectApp.ID=" + QueryID)[0];
                }
                catch
                {
                    Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>alert('��ѯ�ַ�������,�����б�');window.location.href='';</script>'");
                    return;
                }

                lb_Code.Text = model.App_ProjectCode;
                lb_Name.Text = model.App_Code;
                lb_LabType.Text = model.LabType_Name;
                lb_ConType.Text = model.ConType_Name;
                lb_AppTime.Text = model.App_AppTime.Value.ToShortDateString();
                lb_ComTme.Text = model.App_CompletionTime.Value.ToShortDateString();
                lb_InCharge.Text = model.App_InCharge;
                lb_Position.Text = model.PositionName;
                lb_Finace.Text = model.App_ApplyFinancing.ToString();
                lt_Place.Text = model.App_Location;
                lt_Condition.Text = model.App_InstallCondition;
                lt_Nes.Text = model.App_Necessity;
                lb_Phone.Text = model.App_Phone;
                tb_ID.Value=QueryID.ToString();
                lb_State.Text = model.State_Name;

                lb_Lab.Text = model.Lab_Name;

                if (model.App_State == "SubmitNotYet" || model.App_State == "Submitted")
                {
                    if (model.App_State == "SubmitNotYet")
                    {
                        btn_Submit.Visible = true;
                        btn_Cancle.Visible = false;
                        edit.Visible = true;
                        btn_Delete.Visible = true;

                    }
                    else if (model.App_State == "Submitted")
                    {
                        btn_Submit.Visible = false;
                        btn_Cancle.Visible = true;
                        btn_Delete.Visible = false;
                        edit.Visible = false;
                    }
                }
                else
                {
                    btn_Submit.Visible = false;
                    btn_Cancle.Visible = false;
                    edit.Visible = false;
                    btn_Delete.Visible = false;

                }

            }
        }
コード例 #3
0
        protected void DataBinds()
        {
            if (HF_QueryString != QueryString || QueryString <= 0)
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript'>window.location.href='~/err.aspx?Message=��ѯ�ַ�������';</script>");
                return;
            }

            ExtendBLL.ApplicationOther Application = new ExtendBLL.ApplicationOther();

            ExtendModule.ApplicationOther model = new ExtendModule.ApplicationOther();
            model = Application.GetModelList2("ProjectApp.ID=" + QueryString.ToString())[0];

            LabMS.BLL.DictionaryClass DicClass = new LabMS.BLL.DictionaryClass();
            LabMS.Model.DictionaryClass ds = new LabMS.Model.DictionaryClass();
            LabMS.BLL.Dictionary Dic = new LabMS.BLL.Dictionary();
            List<LabMS.Model.Dictionary> lsDic = new List<LabMS.Model.Dictionary>();

            lsDic = Dic.GetModelList("Code='" + model.App_Positions.Trim() + "'");

            if (lsDic.Count == 1)
            {
                tb_Position.Text = lsDic[0].Name;
            }

            tb_Code.Text = model.App_ProjectCode;
            tb_Name.Text = model.App_Code;
            ddl_Lab.Text = model.Lab_Name;
            ddl_LabType.Text = model.LabType_Name;
            ddl_ConType.Text = model.ConType_Name;
            if (model.App_AppTime != null)
            {
                tb_AppTime.Text = model.App_AppTime.Value.ToShortDateString();
            }
            if (model.App_CompletionTime != null)
            {
                tb_CompletionTime.Text = model.App_CompletionTime.Value.ToShortDateString();
            }
            tb_InCharge.Text = model.App_InCharge;
            tb_ApplyFinancing.Text = model.App_ApplyFinancing.ToString();
            tb_AppView.Text = model.App_ArgumentView;
            tb_Phone.Text = model.App_Phone;

            tb_Loction.Text = model.App_Location;
            tb_InstallCondition.Text = model.App_InstallCondition;
            tb_Necessity.Text = model.App_Necessity;

            lsDic = Dic.GetModelList("DClass='Conclusion'");

            ddl_Conclusion.DataSource = lsDic;
            ddl_Conclusion.DataValueField = "Code";
            ddl_Conclusion.DataTextField = "Name";
            ddl_Conclusion.DataBind();
            ddl_Conclusion.Items.Insert(0, new ListItem("--��ѡ����֤����--", "0"));

            string value = "";
            if (ddl_Conclusion.Items.FindByValue(model.App_ArgumentConclusion) != null)
            {
                ddl_Conclusion.Items.FindByValue(model.App_ArgumentConclusion).Selected = true;
                value = ddl_Conclusion.SelectedItem.Text;
            }

            lb_ApproveFinancing.Text = model.App_ApproveFinancing.ToString();
            lb_Conclusion.Text = value;
            lb_AppView.Text = model.App_ArgumentView;

            switch (model.App_State)
            {
                case "Approved":
                    {

                        lb_AppView.Text = model.App_ArgumentView;
                        lb_ApproveFinancing.Text = model.App_ApproveFinancing.Value.ToString();
                        lb_Conclusion.Text = "ͨ����֤";
                        Submit.Visible = false;
                        add_conclusion.Attributes.Add("style", "display:none");
                    }
                    break;
                case "Submitted":
                    {
                        show_conclusion.Attributes.Add("style", "display:none");
                        tb_ApproveFinancing.Visible = false;
                        tb_AppView.Visible = false;

                    }
                    break;
                case "Rejected":
                    {
                        Submit.Visible = true;
                        show_conclusion.Attributes.Add("style", "display:none");
                    }
                    break;

                default:
                    {
                        add_conclusion.Attributes.Add("style", "display:none");
                        Submit.Visible = false;
                        show_conclusion.Attributes.Remove("style");
                        break;
                    }
            }
        }
コード例 #4
0
ファイル: AppTask.aspx.cs プロジェクト: dalinhuang/labms
        protected void DataBinds()
        {
            if (QueryString != HF_QueryString || QueryString <= 0 || HF_QueryString <= 0)
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript>alert('��ѯ�ַ�������');window.location.href='';</script>");
                return;
            }

            ExtendBLL.ApplicationOther Application = new ExtendBLL.ApplicationOther();
            ExtendModule.ApplicationOther model;
            try
            {
                model = new ExtendModule.ApplicationOther();
                model = Application.GetModelList2(" ProjectApp.ID=" + QueryString.ToString())[0];
            }
            catch
            {
                Page.ClientScript.RegisterClientScriptBlock(GetType(), "script", "<script type='text/javascript>window.location.href='err.aspx?Message=��ѯ�ַ�������'</script>");
                return;
            }
            tb_Code.Text = model.App_ProjectCode;
            tb_Name.Text = model.App_Code;
            ddl_Lab.Text = model.Lab_Name;
            ddl_LabType.Text = model.LabType_Name;
            ddl_ConType.Text = model.ConType_Name;
            if (model.App_AppTime != null)
            {
                tb_AppTime.Text = model.App_AppTime.Value.ToShortDateString();
            }
            if (model.App_CompletionTime != null)
            {
                tb_CompletionTime.Text = model.App_CompletionTime.Value.ToShortDateString();
            }
            tb_InCharge.Text = model.App_InCharge;
            tb_Phone.Text = model.App_Phone;
            tb_ApplyFinancing.Text = model.App_ApplyFinancing.ToString();
            tb_ApproveFinancing.Text = model.App_ApproveFinancing.ToString();
            tb_Loction.Text = model.App_Location;
            tb_InstallCondition.Text = model.App_InstallCondition;
            tb_Necessity.Text = model.App_Necessity;
            tb_AppView.Text = model.App_ArgumentView;

            tb_Position.Text = model.PositionName;

            ddl_State.Text = model.State_Name;
        }