コード例 #1
0
    protected void Button_save_Click(object sender, EventArgs e)
    {
        ItemProgInfo itemProgInfo = new ItemProgInfo();

        if (base.Request["pk"] != null)
        {
            itemProgInfo.ID = int.Parse(base.Request["pk"].ToString());
        }
        itemProgInfo.ApproveDate   = DateTime.Parse(this.DateBox_sprq.Text);
        itemProgInfo.ApproveIdea   = this.TextBox_spyj.Text;
        itemProgInfo.ApprovePerson = this.TextBox_spr.Text;
        if (this.RadioButton_ok.Checked)
        {
            itemProgInfo.ApproveResult = 1;
        }
        else
        {
            itemProgInfo.ApproveResult = -1;
        }
        bool flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Sp");

        if (flag)
        {
            string text = " parent.desktop.flowclass.location='/EPC/17/Frame.aspx?url=../../epc/17/PPM/Prog/ItemProgList.aspx&Type=ShenHe&PrjState=0&Levels=0';";
            text += "alert('保存成功');";
            text += "top.frameWorkArea.window.desktop.getActive().close();";
            this.JavaScriptControl1.Text = text;
            return;
        }
        this.JavaScriptControl1.Text = "alert('保存失败!');";
    }
コード例 #2
0
ファイル: itemproglist.aspx.cs プロジェクト: zxl881203/src
    protected void Button_del_Click(object sender, EventArgs e)
    {
        string text = string.Empty;

        foreach (DataGridItem dataGridItem in this.DataGrid1.Items)
        {
            CheckBox checkBox = (CheckBox)dataGridItem.FindControl("chk");
            if (checkBox.Checked)
            {
                text = text + dataGridItem.Cells[2].Text + ",";
            }
        }
        if (string.IsNullOrEmpty(text))
        {
            this.JavaScriptControl1.Text = "top.ui.alert('你没有选中数据!')";
            return;
        }
        text = text.Substring(0, text.Length - 1);
        bool flag = ItemProgAction.Delete(text);

        if (flag)
        {
            this.JavaScriptControl1.Text = "alert('删除成功!');window.location.href=window.location.href";
            return;
        }
        this.JavaScriptControl1.Text = "alert('删除失败!')";
    }
コード例 #3
0
ファイル: itemproglist.aspx.cs プロジェクト: zxl881203/src
 protected void btnCanCel_Click(object sender, EventArgs e)
 {
     if (ItemProgAction.CancelActionItemProg(int.Parse(this.hidItemId.Value)))
     {
         this.JavaScriptControl1.Text = "alert('操作成功!');window.location.href=window.location.href;";
         return;
     }
     this.JavaScriptControl1.Text = "alert('操作失败!')";
 }
コード例 #4
0
    private void bind(string pk)
    {
        ItemProgInfo itemProgInfo = ItemProgAction.GetItemProgInfo(pk);
        DateTime     now          = DateTime.Now;

        this.DateBox_sprq.Text = string.Format("{0:yyyy-MM-dd}", now);
        this.TextBox_spyj.Text = itemProgInfo.ApproveIdea;
        this.TextBox_spr.Text  = itemProgInfo.ApprovePerson;
        if (itemProgInfo.ApproveResult == 1)
        {
            this.RadioButton_ok.Checked = true;
            return;
        }
        if (itemProgInfo.ApproveResult == 0)
        {
            this.RadioButton_no.Checked = true;
        }
    }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         this.Textbox_cfrq.Text = DateTime.Now.ToShortDateString().Replace("/", "-");
         DataTable allProgSortCollections = ProgSortAction.GetAllProgSortCollections();
         this.DropDownList_lb.DataSource     = allProgSortCollections;
         this.DropDownList_lb.DataTextField  = "ProgSortName";
         this.DropDownList_lb.DataValueField = "ProgSortCode";
         this.DropDownList_lb.DataBind();
         if (base.Request.Params["Type"] != null && base.Request.Params["Type"].ToString() == "View")
         {
             this.Button_save.Visible = false;
             this.ButtonColse.Style.Add("display", "");
             this.ButtonColse.Value        = "关 闭";
             this.TextBox_cfdw.ReadOnly    = true;
             this.TextBox_bcfdx.ReadOnly   = true;
             this.Textbox_cfje.ReadOnly    = true;
             this.Textbox_fzr.ReadOnly     = true;
             this.TextBox_cfyj.ReadOnly    = true;
             this.TextBox_cfyy.ReadOnly    = true;
             this.Textbox_bz.ReadOnly      = true;
             this.Textbox_cfrq.ReadOnly    = true;
             this.Textbox_cfdkcdw.ReadOnly = true;
             this.DropDownList_lb.Enabled  = false;
         }
         if (base.Request["pk"] != null)
         {
             this.pk = base.Request["pk"].ToString();
         }
         if (string.IsNullOrWhiteSpace(this.pk) && base.Request["ic"] != null)
         {
             this.pk = ItemProgAction.GetIdByUID(base.Request["ic"]);
         }
         if (!string.IsNullOrWhiteSpace(this.pk))
         {
             this.bind(this.pk);
         }
     }
 }
コード例 #6
0
ファイル: itemproglist.aspx.cs プロジェクト: zxl881203/src
    private void bind()
    {
        DataTable dataTable = new DataTable();

        if (base.Request["PrjCode"] == null || base.Request["Levels"] == null)
        {
            this.DataGrid1.DataSource = "";
            this.DataGrid1.DataBind();
        }
        else
        {
            string text = "prjcode='" + base.Request["PrjCode"].ToString() + "' and ProgSign=" + base.Request["Levels"].ToString();
            if (base.Request["Type"] == "View" || base.Request["Type"] == "List")
            {
                text += " and FlowState=1";
            }
            dataTable = ItemProgAction.GetItemProgCollections(text);
            this.DataGrid1.DataSource = dataTable;
            this.DataGrid1.DataBind();
        }
        this.ViewState[ItemProgList.resourceTable] = dataTable;
    }
コード例 #7
0
ファイル: itemproglist.aspx.cs プロジェクト: zxl881203/src
    protected void Button_query_Click(object sender, EventArgs e)
    {
        DataTable value = new DataTable();

        if (base.Request["PrjCode"] == null || base.Request["Levels"] == null)
        {
            this.DataGrid1.DataSource = "";
            this.DataGrid1.DataBind();
        }
        else
        {
            string text = string.Concat(new string[]
            {
                "prjcode='",
                base.Request["PrjCode"].ToString(),
                "' and ProgSign=",
                base.Request["Levels"].ToString(),
                " and ProgSortCode=",
                this.DropDownList_lb.SelectedValue
            });
            if (base.Request["Type"] == "View" || base.Request["Type"] == "List")
            {
                text += " and FlowState=1";
            }
            if (!string.IsNullOrEmpty(this.TextBox_bcfdx.Text.Trim()))
            {
                text = text + " and ByProgObject like '%" + this.TextBox_bcfdx.Text.Trim() + "%'";
            }
            if (!string.IsNullOrEmpty(this.TextBox_cfdw.Text.Trim()))
            {
                text = text + " and ProgUnit like '%" + this.TextBox_cfdw.Text.Trim() + "%'";
            }
            value = ItemProgAction.GetItemProgCollections(text);
            this.DataGrid1.DataSource = ItemProgAction.GetItemProgCollections(text);
            this.DataGrid1.DataBind();
        }
        this.ViewState[ItemProgList.resourceTable] = value;
    }
コード例 #8
0
ファイル: progsortlist.aspx.cs プロジェクト: zxl881203/src
    protected void Button_del_Click(object sender, EventArgs e)
    {
        int itemProgCount = ItemProgAction.GetItemProgCount("ProgSortCode=" + this.TextBox_pk.Text);

        if (itemProgCount > 0)
        {
            this.JavaScriptControl1.Text = "alert('该类别对应的有奖罚记录,请删除对应的奖罚记录后再删除该类别!');";
            return;
        }
        if (this.TextBox_pk.Text.Trim() == "")
        {
            this.JavaScriptControl1.Text = "alert('请选择删除的记录!')";
            return;
        }
        bool flag = ProgSortAction.Delete(this.TextBox_pk.Text);

        if (flag)
        {
            this.JavaScriptControl1.Text = "alert('删除成功!');window.location.href=window.location.href";
            return;
        }
        this.JavaScriptControl1.Text = "alert('删除失败!')";
    }
コード例 #9
0
    private void bind(string pk)
    {
        ItemProgInfo itemProgInfo = ItemProgAction.GetItemProgInfo(pk);

        this.TextBox_bcfdx.Text            = itemProgInfo.ByProgObject;
        this.Textbox_bz.Text               = itemProgInfo.Remark;
        this.TextBox_cfdw.Text             = itemProgInfo.ProgUnit;
        this.Textbox_cfje.Text             = itemProgInfo.ProgMoney.ToString();
        this.Textbox_cfrq.Text             = itemProgInfo.ProgDate.ToShortDateString().Replace("/", "-");
        this.TextBox_cfyj.Text             = itemProgInfo.ProgGist;
        this.TextBox_cfyy.Text             = itemProgInfo.ProgCause;
        this.Textbox_fzr.Text              = itemProgInfo.Principal;
        this.Textbox_cfdkcdw.Text          = itemProgInfo.ProgBurstunit;
        this.DropDownList_lb.SelectedValue = itemProgInfo.ProgSortCode.ToString();
        string sqlString = string.Empty;

        sqlString = "SELECT mark,filesType FROM Prj_ItemProg WHERE ID=" + itemProgInfo.ID;
        DataTable dataTable = publicDbOpClass.DataTableQuary(sqlString);

        if (dataTable != null && dataTable.Rows.Count > 0 && dataTable.Rows[0]["mark"] != null)
        {
            if (dataTable.Rows[0]["mark"].ToString() != "2")
            {
                this.cbkmark.Checked = true;
                if (dataTable.Rows[0]["filesType"] != null)
                {
                    this.hidenClass.Value = dataTable.Rows[0]["filesType"].ToString();
                }
            }
            else
            {
                this.cbkmark.Checked = false;
            }
            this.hdnmark.Value = dataTable.Rows[0]["mark"].ToString();
        }
    }
コード例 #10
0
    protected void Button_save_Click(object sender, EventArgs e)
    {
        if (this.TextBox_cfyj.Text.Length > this.TextBox_cfyj.MaxLength)
        {
            this.JavaScriptControl1.Text = "alert('奖罚依据输入内容过长!')";
            return;
        }
        if (this.TextBox_cfyy.Text.Length > this.TextBox_cfyy.MaxLength)
        {
            this.JavaScriptControl1.Text = "alert('奖罚原因输入内容过长!')";
            return;
        }
        if (this.Textbox_bz.Text.Length > this.Textbox_bz.MaxLength)
        {
            this.JavaScriptControl1.Text = "alert('备注输入内容过长!')";
            return;
        }
        ItemProgInfo itemProgInfo = new ItemProgInfo();

        if (!string.IsNullOrWhiteSpace(this.pk))
        {
            itemProgInfo.ID = int.Parse(this.pk);
        }
        itemProgInfo.ApproveResult = 0;
        itemProgInfo.ByProgObject  = this.TextBox_bcfdx.Text.Trim();
        itemProgInfo.Remark        = this.Textbox_bz.Text.Trim();
        itemProgInfo.ProgUnit      = this.TextBox_cfdw.Text;
        if (this.Textbox_cfje.Text.Trim() != "")
        {
            itemProgInfo.ProgMoney = decimal.Parse(this.Textbox_cfje.Text.Trim());
        }
        if (this.Textbox_cfrq.Text.Trim() != "")
        {
            itemProgInfo.ProgDate = DateTime.Parse(this.Textbox_cfrq.Text.Trim());
        }
        itemProgInfo.ProgGist      = this.TextBox_cfyj.Text.Trim();
        itemProgInfo.ProgCause     = this.TextBox_cfyy.Text.Trim();
        itemProgInfo.Principal     = this.Textbox_fzr.Text.Trim();
        itemProgInfo.ProgBurstunit = this.Textbox_cfdkcdw.Text.Trim();
        if (base.Request["Levels"] != null)
        {
            itemProgInfo.ProgSign = int.Parse(base.Request["Levels"].ToString());
        }
        if (base.Request["Prjcode"] != null)
        {
            itemProgInfo.PrjCode = base.Request["Prjcode"].ToString();
        }
        if (this.DropDownList_lb.SelectedValue != "")
        {
            itemProgInfo.ProgSortCode = int.Parse(this.DropDownList_lb.SelectedValue);
        }
        string sqlString = string.Empty;
        bool   flag;

        if (string.IsNullOrWhiteSpace(this.pk))
        {
            flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Insert");
            DatumLogic datumLogic = new DatumLogic();
            int        maxID      = datumLogic.getMaxID("Prj_ItemProg", "ID");
            if (this.cbkmark.Checked)
            {
                sqlString = string.Concat(new object[]
                {
                    "UPDATE Prj_ItemProg SET filesType = ",
                    this.DDTClass.SelectedValue,
                    ",[mark] = 3 WHERE ID=",
                    maxID
                });
            }
            else
            {
                sqlString = string.Concat(new object[]
                {
                    "UPDATE Prj_ItemProg SET filesType = ",
                    this.DDTClass.SelectedValue,
                    ",[mark] = 2 WHERE ID=",
                    maxID
                });
            }
        }
        else
        {
            flag = ItemProgAction.ItemProgInfoOp(itemProgInfo, "Update");
            if (this.cbkmark.Checked)
            {
                sqlString = string.Concat(new object[]
                {
                    "UPDATE Prj_ItemProg SET filesType = ",
                    this.DDTClass.SelectedValue,
                    ",[mark] = 3 WHERE ID=",
                    itemProgInfo.ID
                });
            }
            else
            {
                sqlString = string.Concat(new object[]
                {
                    "UPDATE Prj_ItemProg SET filesType = ",
                    this.DDTClass.SelectedValue,
                    ",[mark] = 2 WHERE ID=",
                    itemProgInfo.ID
                });
            }
        }
        if (flag)
        {
            publicDbOpClass.ExecSqlString(sqlString);
            base.RegisterScript("top.ui.tabSuccess({ parentName: '_ItemProgManage' })");
            return;
        }
        this.JavaScriptControl1.Text = "alert('保存失败!');";
    }