示例#1
0
    protected void btn_Del_Click(object sender, EventArgs e)
    {
        int num = CostInputPriAction.deleteCostInputPri(this.RecordID.Value);

        this.CostInputDatabind(this.PrjCodeValue);
        if (num == 1)
        {
            this.Js.Text = "alert('删除成功!');";
            return;
        }
        this.Js.Text = "alert('删除失败!');";
    }
示例#2
0
    protected void btn_save_Click(object sender, EventArgs e)
    {
        CostInputPri costInputPri = new CostInputPri();

        costInputPri.RecordID     = this.RecordID;
        costInputPri.PrjCode      = this.PrjCode.ToString();
        costInputPri.CostItemName = this.txtItemName.Text.Trim();
        costInputPri.HappenDate   = Convert.ToDateTime(this.dbDate.Text.Trim());
        costInputPri.HappenUnit   = this.txtDept.Text.Trim();
        costInputPri.FillPeople   = this.txtUser.Text.Trim();
        costInputPri.TouchMan     = this.HdnPerson.Value.Trim();
        this.DataGridToSession();
        if (CostInputPriAction.insertCostInput(costInputPri, (DataTable)this.ViewState["CostSlave"], this.opType))
        {
            this.JS.Text = "alert('保存成本数据成功!');window.returnValue=true;window.close();";
            return;
        }
        this.JS.Text = "alert('保存成本数据失败!请与管理员联系!');window.returnValue=true;window.close();";
    }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["ic"] != null)
         {
             this.RecordID = new Guid(base.Request.QueryString["ic"]);
         }
         DataTable singleCostInputPriTable = CostInputPriAction.getSingleCostInputPriTable(this.RecordID);
         this.lblItemName.Text = singleCostInputPriTable.Rows[0]["CostItemName"].ToString();
         this.lblDate.Text     = Convert.ToDateTime(singleCostInputPriTable.Rows[0]["HappenDate"].ToString()).ToShortDateString();
         this.lblDept.Text     = singleCostInputPriTable.Rows[0]["HappenUnit"].ToString();
         this.lblUser.Text     = singleCostInputPriTable.Rows[0]["FillPeople"].ToString();
         this.HdnPerson.Value  = singleCostInputPriTable.Rows[0]["TouchMan"].ToString();
         this.lblPerson.Text   = PageHelper.QueryUser(this, singleCostInputPriTable.Rows[0]["TouchMan"].ToString());
         DataTable costInputSlaveTable = CostInputSlaveAction.getCostInputSlaveTable(this.RecordID);
         this.ViewState["CostSlave"]      = costInputSlaveTable;
         this.dgCostInputSlave.DataSource = (DataTable)this.ViewState["CostSlave"];
         this.dgCostInputSlave.DataBind();
     }
 }
示例#4
0
 protected void btn_save_Click(object sender, EventArgs e)
 {
     try
     {
         CostInputPri objInfo = this.CreatModelObject();
         int          num     = CostInputPriAction.updateCostJudgePri(objInfo);
         if (num == 1)
         {
             this.Js.Text = "alert('审核成功!');window.close();";
         }
         else
         {
             this.Js.Text = "alert('审核失败!');";
         }
     }
     catch (Exception ex)
     {
         this.Js.Text = "alert('数据库连接失败!')";
         throw ex;
     }
 }
示例#5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (base.Request.QueryString["RecordID"] == null || base.Request.QueryString["RecordID"].ToString() == "")
         {
             this.RecordID = Guid.NewGuid();
         }
         else
         {
             this.RecordID = new Guid(base.Request.QueryString["RecordID"].ToString());
         }
         this.PrjCode = base.Request.QueryString["PrjCode"].ToString();
         this.opType  = base.Request.QueryString["opType"].ToString();
         if (this.opType == "add")
         {
             userManageDb userManageDb = new userManageDb();
             this.txtUser.Text    = userManageDb.GetUserName(base.UserCode);
             this.dbDate.Text     = DateTime.Now.ToShortDateString();
             this.HdnPerson.Value = base.UserCode;
             this.TxtPerson.Value = userManageDb.GetUserName(base.UserCode);
         }
         if (this.opType == "edit")
         {
             DataTable singleCostInputPriTable = CostInputPriAction.getSingleCostInputPriTable(this.RecordID);
             this.txtItemName.Text = singleCostInputPriTable.Rows[0]["CostItemName"].ToString();
             this.dbDate.Text      = Convert.ToDateTime(singleCostInputPriTable.Rows[0]["HappenDate"].ToString()).ToShortDateString();
             this.txtDept.Text     = singleCostInputPriTable.Rows[0]["HappenUnit"].ToString();
             this.txtUser.Text     = singleCostInputPriTable.Rows[0]["FillPeople"].ToString();
             this.HdnPerson.Value  = singleCostInputPriTable.Rows[0]["TouchMan"].ToString();
             this.TxtPerson.Value  = com.jwsoft.pm.entpm.PageHelper.QueryUser(this, singleCostInputPriTable.Rows[0]["TouchMan"].ToString());
         }
         DataTable costInputSlaveTable = CostInputSlaveAction.getCostInputSlaveTable(this.RecordID);
         this.ViewState["CostSlave"]      = costInputSlaveTable;
         this.dgCostInputSlave.DataSource = (DataTable)this.ViewState["CostSlave"];
         this.dgCostInputSlave.DataBind();
         this.btnDel.Attributes["onclick"] = "javascript:doWith();";
     }
 }
示例#6
0
    private void LoadDateToPage()
    {
        DataTable singleCostInputPriTable = CostInputPriAction.getSingleCostInputPriTable(new Guid(this.ViewState["RecordID"].ToString()));

        this.ProjectCode          = new Guid(singleCostInputPriTable.Rows[0]["PrjCode"].ToString().Trim());
        this.txt_AuditPeople.Text = ((singleCostInputPriTable.Rows[0]["AuditPeople"].ToString() != "") ? singleCostInputPriTable.Rows[0]["AuditPeople"].ToString() : userManageDb.GetCurrentUserInfo().UserName);
        if (singleCostInputPriTable.Rows[0]["AuditDate"].ToString() == null || singleCostInputPriTable.Rows[0]["AuditDate"].ToString() == "")
        {
            this.txt_AuditDate.Text = DateTime.Now.Date.ToString("d");
        }
        else
        {
            this.txt_AuditDate.Text = DateTime.Parse(singleCostInputPriTable.Rows[0]["AuditDate"].ToString()).ToString("d");
        }
        this.txt_Remark.Text = singleCostInputPriTable.Rows[0]["Remark"].ToString();
        if (singleCostInputPriTable.Rows[0]["AuditResult"].ToString() == "False")
        {
            this.ddl_AuditResult.SelectedValue = "0";
            return;
        }
        this.ddl_AuditResult.SelectedValue = "1";
    }