Ejemplo n.º 1
0
        private void ToolStripButton_Click(object sender, EventArgs e)
        {
            ToolStripButton Button   = sender as ToolStripButton;
            int             RowIndex = FpSpread.ActiveSheet.ActiveRowIndex;

            if (RowIndex != -1)
            {
                if (DialogResult.OK == MessageBox.Show("确认将选中的申请设置为 ‘" + Button.Text + "’?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information))
                {
                    List <DataModificationInfo> Infos = new List <DataModificationInfo>();
                    List <String> IDs = new List <String>();

                    String   Tag    = FpSpread.ActiveSheet.ActiveRow.Tag.ToString();
                    String[] Tokens = Tag.Split(',');
                    IDs.Add(Tokens[0]);

                    Boolean        Result  = DepositoryDataModificationInfo.UpdateDataModificationInfo(IDs.ToArray(), Yqun.Common.ContextCache.ApplicationContext.Current.UserName, Button.Text, "");
                    String         Message = (Result ? "设置成功。" : "设置失败");
                    MessageBoxIcon Icon    = (Result ? MessageBoxIcon.Information : MessageBoxIcon.Error);
                    MessageBox.Show(Message, "提示", MessageBoxButtons.OK, Icon);

                    if (Result)
                    {
                        FpSpread.ActiveSheet.Rows[RowIndex].Visible = false;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void bt_save_jlyj_Click(object sender, EventArgs e)
        {
            bool flag = false;

            bool IsRequest = false;

            dtRequest = DepositoryDataModificationInfo.HaveDataModificationInfoByID(RequestID.ToString());
            if (dtRequest != null && dtRequest.Rows.Count > 0)
            {
                if (dtRequest.Rows[0]["State"].ToString() == "已提交")
                {
                    if (Yqun.Common.ContextCache.ApplicationContext.Current.InCompany.Type == "@unit_监理单位" ||
                        Yqun.Common.ContextCache.ApplicationContext.Current.IsAdministrator)
                    {
                        IsRequest = true;
                    }
                }
            }
            if (string.IsNullOrEmpty(tb_jlyj.Text.Trim()) && IsRequest == true)
            {
                MessageBox.Show("监理意见不能为空!");
                return;
            }
            if (tb_jlyj.Text.Trim() == "")
            {
                if (MessageBox.Show("当前内容为空,您确定保存吗?", "保存确定对话框", MessageBoxButtons.OKCancel)
                    == DialogResult.OK)
                {
                    flag = true;
                }
                else
                {
                    return;
                }
            }
            else
            {
                flag = true;
            }
            if (flag)
            {
                DepositoryEvaluateDataList.SaveInvalidReportNote(invalidReportID, tb_jlyj.Text.Trim(), 1);
                if (dtRequest != null && dtRequest.Rows.Count > 0 && dtRequest.Rows[0]["State"].ToString() == "已提交")
                {
                    if (Yqun.Common.ContextCache.ApplicationContext.Current.InCompany.Type == "@unit_监理单位" ||
                        Yqun.Common.ContextCache.ApplicationContext.Current.IsAdministrator)
                    {
                        string strYesOrNo = "";
                        if (rdoYes.Checked)
                        {
                            strYesOrNo = rdoYes.Text;
                        }
                        else if (rdoNo.Checked)
                        {
                            strYesOrNo = rdoNo.Text;
                        }
                        if (!string.IsNullOrEmpty(strYesOrNo))
                        {
                            Boolean Result = DepositoryDataModificationInfo.UpdateDataModificationInfo(new string[] { RequestID.ToString() }, Yqun.Common.ContextCache.ApplicationContext.Current.UserName, strYesOrNo, tb_jlyj.Text.Trim());
                        }
                    }
                }

                MessageBox.Show("保存成功");
                //Close();
            }
        }