Exemplo n.º 1
0
 /// <summary>
 /// 页面加载
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (ActionValidator("Contract"))
         {
             var query = DbHelperSql.Query("select DISTINCT EnterpriseName from  Eenterprises where Audit='已通过'");
             DropDownList_qy.DataSource     = query;
             DropDownList_qy.DataTextField  = "EnterpriseName";
             DropDownList_qy.DataValueField = "EnterpriseName";
             DropDownList_qy.DataBind();
             if (!string.IsNullOrEmpty(Request.QueryString["ContractName"]))
             {
                 var entity = DbHelperSql.Query("select * from Contract where ContractName='" + Request.QueryString["ContractName"] + "'");
                 txtTrueName.Text = entity.Tables[0].Rows[0]["ContractName"].ToString();
                 time.Text        = entity.Tables[0].Rows[0]["CInformation"].ToString(); //签订时间
                 time2.Text       = entity.Tables[0].Rows[0]["LastTime"].ToString();     //到期时间
                 TextBox_JE.Text  = entity.Tables[0].Rows[0]["Money"].ToString();        //金额
                 txtj.Text        = entity.Tables[0].Rows[0]["ConsigneeA"].ToString();
                 txty.Text        = entity.Tables[0].Rows[0]["ConsigneeB"].ToString();
                 txtb.Text        = entity.Tables[0].Rows[0]["Note"].ToString();
                 DropDownList_qy.SelectedValue = entity.Tables[0].Rows[0]["EnterpriseName"].ToString();
             }
         }
         else
         {
             AlertAndParentSkip("没有权限", "ContractList");
         }
     }
 }
 /// <summary>
 /// 页面加载
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (ActionValidator("EmployeeAdd"))
         {
             //绑定企业下拉列表框
             var query = DbHelperSql.Query("select DISTINCT EnterpriseName from  Eenterprises where Audit='已通过'");
             DropDownList_qy.DataSource     = query;
             DropDownList_qy.DataTextField  = "EnterpriseName";
             DropDownList_qy.DataValueField = "EnterpriseName";
             DropDownList_qy.DataBind();
             //判断是否为修改操作
             if (!string.IsNullOrEmpty(Request.QueryString["EID"]))
             {
                 var model = _employeeBLL.GetModel(int.Parse(Request.QueryString["EID"]));
                 DropDownList_qy.SelectedValue = model.EnterpriseName;
                 DropDownListXM.SelectedValue  = model.ProjectName;
                 TextBoxName.Text = model.EmployeeName;
                 person_time.Text = model.EmployeeTime;
                 txty.Text        = model.Note;
             }
         }
         else
         {
             AlertAndParentSkip("没有权限", "EmployeeList");
         }
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }

            if (!ActionValidator("ProjectAdd"))
            {
                return;
            }

            //帮定已经通过的企业到下拉列表控件
            var query = DbHelperSql.Query("select DISTINCT EnterpriseName from  Eenterprises where Audit='已通过'");

            DropDownList_qy.DataSource     = query;
            DropDownList_qy.DataTextField  = "EnterpriseName";
            DropDownList_qy.DataValueField = "EnterpriseName";
            DropDownList_qy.DataBind();

            //判断是否为修改操作
            if (string.IsNullOrEmpty(Request.QueryString["ProjectID"]))
            {
                return;
            }

            DataSet dsProject = DbHelperSql.Query("select * from Project where ProjectID='" + Request.QueryString["ProjectID"] + "'");

            if (dsProject.Tables[0].Rows.Count > 0)
            {
                txtTrueName.Text = dsProject.Tables[0].Rows[0]["ProjectName"].ToString();
                person.Text      = dsProject.Tables[0].Rows[0]["PersonInCharge"].ToString();
                txty.Text        = dsProject.Tables[0].Rows[0]["Note"].ToString();
                DropDownList_qy.SelectedValue = dsProject.Tables[0].Rows[0]["EnterpriseName"].ToString();
            }
            else
            {
                AlertAndParentReoload("该数据不存在,请检查后重试!");
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// 页面加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            if (ActionValidator("FinancialAdd"))
            {
                var query = DbHelperSql.Query("select DISTINCT EnterpriseName from  Eenterprises where Audit='已通过'");
                DropDownList_qy.DataSource     = query;
                DropDownList_qy.DataTextField  = "EnterpriseName";
                DropDownList_qy.DataValueField = "EnterpriseName";
                DropDownList_qy.DataBind();

                var entity = DbHelperSql.Query("select DISTINCT ProjectName from  Project ");
                DropDownListXM.DataSource     = entity;
                DropDownListXM.DataTextField  = "ProjectName";
                DropDownListXM.DataValueField = "ProjectName";
                DropDownListXM.DataBind();
                if (!string.IsNullOrEmpty(Request.QueryString["FID"]))
                {
                    var data = DbHelperSql.Query("select * from Financial where FID='" + Request.QueryString["FID"] + "'");
                    txtTrueMoney.Text           = data.Tables[0].Rows[0]["PayMoney"].ToString();
                    FZperson.Text               = data.Tables[0].Rows[0]["Person"].ToString();
                    DropDownList2.SelectedValue = data.Tables[0].Rows[0]["IsPay"].ToString();
                    time.Text = data.Tables[0].Rows[0]["SuccessfulTime"].ToString();
                    note.Text = data.Tables[0].Rows[0]["Note"].ToString();
                    //项目
                    DropDownListXM.SelectedValue = data.Tables[0].Rows[0]["ProjectName"].ToString();
                    //企业
                    DropDownList_qy.SelectedValue = data.Tables[0].Rows[0]["EnterpriseName"].ToString();
                }
            }
            else
            {
                AlertAndParentSkip("没有权限", "FinancialList");
            }
        }