Example #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.LoanWflTempl> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.LoanWflTempl> modelList = new List <LPWeb.Model.LoanWflTempl>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.LoanWflTempl model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.LoanWflTempl();
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    if (dt.Rows[n]["WflTemplId"].ToString() != "")
                    {
                        model.WflTemplId = int.Parse(dt.Rows[n]["WflTemplId"].ToString());
                    }
                    if (dt.Rows[n]["ApplyDate"].ToString() != "")
                    {
                        model.ApplyDate = DateTime.Parse(dt.Rows[n]["ApplyDate"].ToString());
                    }
                    if (dt.Rows[n]["ApplyBy"].ToString() != "")
                    {
                        model.ApplyBy = int.Parse(dt.Rows[n]["ApplyBy"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Example #2
0
    protected void btnApplyWfl_Click(object sender, EventArgs e)
    {
        int iWorkflowTemplID = Convert.ToInt32(this.ddlWfTemps.SelectedValue);
        //string sJsCodes = "window.parent.document.getElementById('ifrLoanInfo').contentWindow.location.reload();window.location.href=window.location.href;";
        string sJsCodes = "window.location.href=window.location.href;";

        var request = new GenerateWorkflowRequest
        {
            FileId          = CurrentFileId,
            WorkflowTemplId = iWorkflowTemplID,
            hdr             = new ReqHdr {
                UserId = new LoginUser().iUserID
            }
        };

        GenerateWorkflowResponse response = null;

        try
        {
            ServiceManager sm = new ServiceManager();
            using (LP2ServiceClient client = sm.StartServiceClient())
            {
                response = client.GenerateWorkflow(request);
            }
        }
        catch (System.ServiceModel.EndpointNotFoundException)
        {
            string sExMsg = string.Format("Failed to apply workflow template: {0}", "Workflow Manager is not running.", iWorkflowTemplID);
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            PageCommon.WriteJsEnd(this, sExMsg, sJsCodes);
        }
        catch (Exception ex)
        {
            string sExMsg = string.Format("Failed to apply workflow template: {0}, error detail:", ex.Message);
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            PageCommon.WriteJsEnd(this, sExMsg, sJsCodes);
        }

        if (response.hdr.Successful == false)
        {
            PageCommon.WriteJsEnd(this, "Failed to apply workflow template: " + response.hdr.StatusInfo, sJsCodes);
        }
        System.Threading.Thread.Sleep(2000);
        var CurrentUserId = this.CurrUser.iUserID;

        LPWeb.Model.LoanWflTempl lWflTempModel = new LPWeb.Model.LoanWflTempl();
        lWflTempModel.FileId     = CurrentFileId;
        lWflTempModel.ApplyBy    = CurrentUserId;
        lWflTempModel.ApplyDate  = DateTime.Now;
        lWflTempModel.WflTemplId = iWorkflowTemplID;
        LPWeb.BLL.LoanWflTempl bLoanWflTempl = new LoanWflTempl();
        bLoanWflTempl.Apply(lWflTempModel);

        // success
        PageCommon.WriteJsEnd(this, "Applied workflow template successfully.", sJsCodes);
    }
Example #3
0
    protected void ApplyLoanWflTempl(int iFileID, int iWflTempID, int iUserID)
    {
        #region LoanWflTempl

        LPWeb.Model.LoanWflTempl WflTempModel = new LPWeb.Model.LoanWflTempl();
        WflTempModel.FileId     = iFileID;
        WflTempModel.WflTemplId = iWflTempID;
        WflTempModel.ApplyBy    = iUserID;
        WflTempModel.ApplyDate  = DateTime.Now;

        LPWeb.BLL.LoanWflTempl LoanWflTemplMgr = new LoanWflTempl();

        LoanWflTemplMgr.Apply(WflTempModel);

        #endregion
    }
Example #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.LoanWflTempl model)
 {
     dal.Update(model);
 }
Example #5
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(LPWeb.Model.LoanWflTempl model)
 {
     return(dal.Add(model));
 }
Example #6
0
 public void Apply(LPWeb.Model.LoanWflTempl model)
 {
     dal.Apply(model);
 }