示例#1
0
        /// <summary>
        /// 提交按钮处理事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void SubmitBtn_Click(object sender, EventArgs e)
        {
            try
            {
                //提交动作
                string strActionName = ((Button)sender).Text.Trim();
                base.SubAction = strActionName;

                string strErrorMessage = string.Empty;

                //保存
                if (strActionName == ProcessConstString.SubmitAction.ACTION_SAVE_DRAFT)
                {
                    B_FinanceZDBX entity = ControlToEntity(true) as B_FinanceZDBX;
                    entity.SubmitAction = strActionName;
                    base.FormSubmit(true, strActionName, null, entity);
                }
                else
                {
                    B_FinanceZDBX entity = ControlToEntity(false) as B_FinanceZDBX;
                    entity.SubmitAction = strActionName;

                    //撤销
                    if (strActionName == ProcessConstString.SubmitAction.ACTION_CANCEL)
                    {
                        base.FormCancel(entity);
                    }
                    else
                    {
                        //返回验证信息
                        entity.GetSubmitMessage(base.StepName, strActionName, ref strErrorMessage);
                        if (!string.IsNullOrEmpty(strErrorMessage))
                        {
                            JScript.ShowMsgBox(this.Page, strErrorMessage, false);
                            return;
                        }
                        else
                        {
                            switch (base.StepName)
                            {
                            case ProcessConstString.StepName.STEP_DRAFT:
                                strActionName = base.SubAction;
                                break;

                            case ProcessConstString.StepName.FinanceStepName.STEP_DISTRIBUTION:
                                if (strActionName == ProcessConstString.SubmitAction.FinanceAction.ACTION_WCGD)
                                {
                                    try
                                    {
                                        string strMessage = string.Empty;
                                        //this.Devolve(out strMessage);
                                        base.Devolved(base.ProcessID, base.TemplateName);
                                        JScript.Alert("归档成功!\\n流水号:" + strMessage, false);
                                    }
                                    catch (Exception ex)
                                    {
                                        base.WriteLog(ex.Message);
                                        JScript.Alert("归档失败!请查看配置是否正确!", false);
                                        return;
                                    }
                                }
                                break;
                            }
                        }

                        //调用工作流
                        Hashtable nValues = entity.GetProcNameValue(base.StepName, strActionName);
                        base.FormSubmit(false, strActionName, nValues, entity);
                    }
                }
            }
            catch (Exception ex)
            {
                base.ShowMsgBox(this.Page, MsgType.VbExclamation, ex.Message);
            }
        }