예제 #1
0
        void btn_Submit_Click(object sender, EventArgs e)
        {
            Excel.Workbook wb;
            Excel.Worksheet sheet;
            wb = dsoFramerWordControl1.AxFramerControl.ActiveDocument as Excel.Workbook;
            if (activeSheetName != "")
            {
                sheet = wb.Application.Sheets[activeSheetName] as Excel.Worksheet;
            }
            else
            {
                sheet = wb.Application.Sheets[1] as Excel.Worksheet;
            }
            activeSheetIndex = sheet.Index;
            if (filecontrol != null)
            {
                if (filecontrol.Isupfile)
                {
                    MsgBox.ShowTipMessageBox("请稍后,正在上传文件");
                    return;
                } 
                if (filecontrol.Isdownfile)
                {
                    if (MsgBox.ShowAskMessageBox("正在下载文件,确认提交?") != DialogResult.OK)
                    {
                        return;
                    }
                   
                }
            }
            for (int i = 1; i <= wb.Application.Sheets.Count; i++)
            {
                if (i != activeSheetIndex)
                {
                    Excel.Worksheet tmpSheet = (Excel.Worksheet)wb.Application.Sheets.get_Item(i);
                    try
                    {
                        if (tmpSheet != null) tmpSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible ;
                    }
                    catch { }

                }
            }
            unLockExcel(wb,sheet);
            for (int i = 1; sheet.Protection.AllowEditRanges.Count > 0; )
            {
                Excel.AllowEditRange editRange = sheet.Protection.AllowEditRanges.get_Item(i);
                editRange.Delete();
            }
            LockExcel(wb, sheet);
            byte[] bt = new byte[0];
            string strmes = "";
            WF_WorkTaskCommands wt;
            switch (status)
            {
                case "add":
                    //LP_Record newRecord = new LP_Record();
                    dsoFramerWordControl1.FileSave();
                    currRecord.DocContent = dsoFramerWordControl1.FileDataGzip;
                    currRecord.Kind = kind;
                    currRecord.Content = GetContent();
                    if (ctrlNumber!=null)
                        currRecord.Number = ctrlNumber.Text;
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.LastChangeTime= DateTime.Now.ToString();

                    //string[] strtemp = RecordWorkTask.RunNewGZPRecord(currRecord.ID, kind, MainHelper.User.UserID);
                    wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
                    if (wt != null)
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
                    }
                    else
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
                    }
                    //strmes = strtemp[0];
                    //currRecord.Status = strtemp[1];
                    if (strmes.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(strmes);
                    strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                    if (strmes == "结束节点1")
                    {
                        currRecord.Status = "存档";
                    }
                    else
                    {
                        currRecord.Status = strmes;
                    }
                    currRecord.LastChangeTime = DateTime.Now.ToString();
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
                    rowData = null;
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                        MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);
                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                             PJ_lcfj lcfu = new PJ_lcfj();
                             lcfu.ID = lcfu.CreateID();
                             lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                             lcfu.FileRelativePath =  filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                             lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                             lcfu.RecordID = currRecord.ID;
                             lcfu.Creattime = DateTime.Now;
                             Thread.Sleep((new TimeSpan(100000)));//0.1毫秒
                             if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                             MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                         }
                    
                    }
                    //currRecord = newRecord;
                    break;
                case "edit":
                    currRecord.LastChangeTime = DateTime.Now.ToString();
                    dsoFramerWordControl1.FileSave();
                    currRecord.DocContent = this.dsoFramerWordControl1.FileDataGzip;
                    //byte[] bt = new byte[0];
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.Content = GetContent();
                    wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
                    if (wt != null)
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
                    }
                    else
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(),  "提交");
                    }
                    if (strmes.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(strmes);
                    strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                    if (strmes == "结束节点1")
                    {
                        CurrRecord.Status = "存档";
                    }
                    else
                    {
                        CurrRecord.Status = strmes;
                    }
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    MainHelper.PlatformSqlMap.Update("UpdateLP_Record", CurrRecord);
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                        MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);

                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                            PJ_lcfj lcfu = new PJ_lcfj();
                            lcfu.ID = lcfu.CreateID();
                            lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                            lcfu.FileRelativePath = filecontrol.UpfilePath + "/" + filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                            lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                            lcfu.RecordID = currRecord.ID;
                            lcfu.Creattime = DateTime.Now;
                            if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                            MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                        }

                    }
                    rowData = null;                   
                    break;
            }
            ArrayList akeys=new ArrayList(valuehs.Keys);
            List<object> list = new List<object>();
            for (int i = 0; i < akeys.Count;i++ )
            {
                WF_TableFieldValue wfv = valuehs[akeys[i]] as WF_TableFieldValue;
                wfv.ID = wfv.CreateID();
                wfv.RecordId = currRecord.ID;
                wfv.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                wfv.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                wfv.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                wfv.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                wfv.UserControlId = parentTemple.LPID;
                Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                list.Add(wfv);
            }
            if (list.Count > 0)
            {
                Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(list, null, null);
            }
            dsoFramerWordControl1.FileSave();
            dsoFramerWordControl1.FileClose();
            this.DialogResult = DialogResult.OK;
        }
예제 #2
0
        void btn_Back_Click(object sender, EventArgs e)
        {
            //请求确认
            if (MsgBox.ShowAskMessageBox("是否确认退回?") != DialogResult.OK)
            {
                return;
            }
            string strmes = RecordWorkTask.RunWorkFlowBack(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
            if (strmes.IndexOf("未提交至任何人") > -1)
            {
                MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                return;
            }
            else
            {

                currRecord.LastChangeTime = DateTime.Now.ToString();
                currRecord.Status = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
                MsgBox.ShowTipMessageBox(strmes);

            }
            if (hqyjcontrol != null)
            {
                PJ_lcspyj lcyj = new PJ_lcspyj();
                lcyj.Charman = MainHelper.User.UserName;
                lcyj.ID = PJ_lcspyj.Newid();
                lcyj.RecordID = currRecord.ID;
                lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                lcyj.Creattime = DateTime.Now;
                if (hqyjcontrol.nowMemoEdit.Text != "")
                    MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);

            }
            dsoFramerWordControl1.FileSave();
            dsoFramerWordControl1.FileClose();
            this.DialogResult = DialogResult.OK;
        }
예제 #3
0
        void btn_Submit_Click(object sender, EventArgs e)
        {
            if (filecontrol != null)
            {
                if (filecontrol.Isupfile)
                {
                    MsgBox.ShowTipMessageBox("请稍后,正在上传文件");
                    return;
                }
                if (filecontrol.Isdownfile)
                {
                    if (MsgBox.ShowAskMessageBox("正在下载文件,确认提交?") != DialogResult.OK)
                    {
                        return;
                    }

                }
            }
            dsoFramerWordControl1.FileSave();
            currRecord.DocContent = dsoFramerWordControl1.FileDataGzip;
            parentTemple.DocContent = dsoFramerWordControl1.FileDataGzip;
            currRecord.Kind = kind;
            currRecord.Content = GetContent();
            if (ctrlNumber != null)
                currRecord.Number = ctrlNumber.Text;
            //currRecord.ImageAttachment = bt;
            //currRecord.SignImg = bt;
            currRecord.LastChangeTime = DateTime.Now.ToString();
            
            string strmes = "";
            WF_WorkTaskCommands wt;

            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData))
            {

                RecordWorkTask.CreatRiZhi(WorkFlowData, dsoFramerWordControl1, currRecord.ID, new object[] { currRecord });

            }
            //string[] strtemp = RecordWorkTask.RunNewGZPRecord(currRecord.ID, kind, MainHelper.User.UserID);
            wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
            if (wt != null)
            {
                strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
            }
            else
            {
                strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
            }
            if (strmes.IndexOf("未提交至任何人") > -1)
            {
                MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                return;
            }
            else
                MsgBox.ShowTipMessageBox(strmes);
            strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
            if (strmes == "结束节点1")
            {
                currRecord.Status = "存档";
            }
            else
            {
                currRecord.Status = strmes;
            }
            if (currRecord.DocContent == null)
            {
                currRecord.DocContent = new byte[0];
            }
            if (currRecord.ImageAttachment== null)
            {
                currRecord.ImageAttachment = new byte[0];
            }
            if (currRecord.SignImg == null)
            {
                currRecord.SignImg = new byte[0];
            }
            currRecord.LastChangeTime = DateTime.Now.ToString();
            if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
            if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
            MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
            rowData = null;
            if (hqyjcontrol != null)
            {
                PJ_lcspyj lcyj = new PJ_lcspyj();
                lcyj.Charman = MainHelper.User.UserName;
                lcyj.ID = PJ_lcspyj.Newid();
                lcyj.RecordID = currRecord.ID;
                lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                lcyj.Creattime = DateTime.Now;
                if (hqyjcontrol.nowMemoEdit.Text != "")
                MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);
            }
            if (filecontrol != null)
            {
                for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                {

                    PJ_lcfj lcfu = new PJ_lcfj();
                    lcfu.ID = lcfu.CreateID();
                    lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                    lcfu.FileRelativePath = filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                    lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                    lcfu.RecordID = currRecord.ID;
                    lcfu.Creattime = DateTime.Now;
                    Thread.Sleep((new TimeSpan(100000)));//0.1毫秒已上传
                    if ( filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                    MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                }

            }
            WF_ModleCheckTable mc = new WF_ModleCheckTable();
            mc.RecordId = currRecord.ID;
            mc.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
            mc.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
            mc.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
            mc.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
            mc.DocContent = currRecord.DocContent;
            mc.Creattime = DateTime.Now;
            Thread.Sleep((new TimeSpan(100000)));//0.1毫秒
            MainHelper.PlatformSqlMap.Create<WF_ModleCheckTable>(mc);
            
            
            this.DialogResult = DialogResult.OK;
        }
예제 #4
0
        void btn_Submit_Click(object sender, EventArgs e)
        {
            Excel.Workbook wb;
            //Excel.Worksheet sheet;
            wb = dsoFramerWordControl1.AxFramerControl.ActiveDocument as Excel.Workbook;
            if (activeSheetName != "")
            {
                sheet = wb.Application.Sheets[activeSheetName] as Excel.Worksheet;
            }
            else
            {
                sheet = wb.Application.Sheets[1] as Excel.Worksheet;
            }
            //activeSheetIndex = sheet.Index;
            if (filecontrol != null)
            {
                if (filecontrol.Isupfile)
                {
                    MsgBox.ShowTipMessageBox("请稍后,正在上传文件");
                    return;
                }
                if (filecontrol.Isdownfile)
                {
                    if (MsgBox.ShowAskMessageBox("正在下载文件,确认提交?") != DialogResult.OK)
                    {
                        return;
                    }

                }
            }
            for (int i = 1; i <= wb.Application.Sheets.Count; i++)
            {
                if (i != activeSheetIndex)
                {
                    Excel.Worksheet tmpSheet = (Excel.Worksheet)wb.Application.Sheets.get_Item(i);
                    try
                    {
                        if (tmpSheet != null) tmpSheet.Visible = Excel.XlSheetVisibility.xlSheetVisible;
                    }
                    catch { }

                }
            }
            unLockExcel(wb, sheet);
            for (int i = 1; sheet.Protection.AllowEditRanges.Count > 0; )
            {
                Excel.AllowEditRange editRange = sheet.Protection.AllowEditRanges.get_Item(i);
                editRange.Delete();
            }
            LockExcel(wb, sheet);
            byte[] bt = new byte[0];
            string strmes = "";
            WF_WorkTaskCommands wt;
            if (strNumber != "") currRecord.Number = strNumber;
            ArrayList akeys = new ArrayList(valuehs.Keys);
            List<object> list = new List<object>();

            DateTime dt = DateTime.Now;
            Random rd = new Random();
            int irpos = 5001;
            WF_TableFieldValue wfv = null;
            decimal dtemp = Convert.ToDecimal(dt.ToString("yyyyMMddHHmmssffffff"));
            for (int i = 0; i < akeys.Count; i++)
            {
                wfv = valuehs[akeys[i]] as WF_TableFieldValue;
                if (wfv.XExcelPos != -1 && wfv.YExcelPos != -1)
                    wfv.ID = Convert.ToString((dtemp + wfv.YExcelPos + wfv.XExcelPos * 10000));
                else
                {

                    wfv.ID = Convert.ToString((dtemp + irpos + irpos * 10000));
                    irpos++;
                }
                wfv.RecordId = currRecord.ID;
                wfv.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                wfv.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                wfv.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                wfv.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                wfv.UserControlId = parentTemple.LPID;
                //MainHelper.PlatformSqlMap.Create<WF_TableFieldValue>(wfv);
                //Thread.Sleep(new TimeSpan(100000));//0.1毫秒
                wfv.ID = wfv.CreateID() + new Random().Next(10, 99);
                list.Add(wfv);
                MainHelper.PlatformSqlMap.DeleteByWhere<WF_TableFieldValue>(" where FieldId ='" + wfv.FieldId + "' and WorkFlowInsId='" + WorkFlowData.Rows[0]["WorkFlowInsId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
            }
            //foreach (WF_TableFieldValue wfv in list)
            //{
            //    Console.Write(wfv.ID+"\r\n");
            //}

            if (RecordWorkTask.CheckOnRiZhi(WorkFlowData))
            {

                RecordWorkTask.CreatRiZhi(WorkFlowData, dsoFramerWordControl1, currRecord.ID, new object[] { currRecord });

            }
            //RecordWorkTask.CreateJL(WorkFlowData, dsoFramerWordControl1, currRecord.ID, new object[] { currRecord });
            if (strxiestatus == "add")
            {
                if (list.Count > 0)
                {

                    Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(list, null, null);

                }
            }
            else
            {
                if (list.Count > 0)
                {
                    foreach (WF_TableFieldValue wfv2 in list)
                    {
                        WF_TableFieldValue wtfvtemp = Client.ClientHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(" where  UserControlId='" + parentTemple.LPID + "'"
                             + " and   WorkflowId='" + wfv2.WorkFlowId + "'"
                             + " and   RecordId='" + wfv2.RecordId + "'"
                             + " and   UserControlId='" + wfv2.UserControlId + "'"
                             + " and   WorkFlowInsId='" + wfv2.WorkFlowInsId + "'"
                             + " and   fieldname='" + wfv2.FieldName + "'"
                             + " and   FieldId='" + wfv2.FieldId + "'"
                             + " and   XExcelPos='" + wfv2.XExcelPos + "'"
                             + " and   YExcelPos='" + wfv2.YExcelPos + "'"
                             + " and   WorkTaskId='" + wfv2.WorkTaskId + "'"
                             );
                        if (wtfvtemp != null)
                            wfv2.ID = wtfvtemp.ID;
                        else
                        {
                            wfv2.ID = wfv2.CreateID();
                            Client.ClientHelper.PlatformSqlMap.Create<WF_TableFieldValue>(wfv2);
                        }
                    }
                    Client.ClientHelper.PlatformSqlMap.ExecuteTransationUpdate(null, list, null);
                }
            }
            LP_Temple lp = MainHelper.PlatformSqlMap.GetOne<LP_Temple>(" where  ParentID='" + parentTemple.LPID + "' and SortID=1");
            if (lp != null)
            {
                if (wfv == null)
                {
                    wfv = new WF_TableFieldValue();
                    wfv.ID = wfv.CreateID();
                    wfv.RecordId = currRecord.ID;
                    wfv.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                    wfv.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                    wfv.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                    wfv.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    wfv.UserControlId = parentTemple.LPID;
                    wfv.ControlValue = "";
                    wfv.FieldId = lp.LPID;
                    wfv.FieldName = lp.CellName;
                    wfv.XExcelPos = GetCellPos(lp.CellPos)[0];
                    wfv.YExcelPos = GetCellPos(lp.CellPos)[1];
                    wfv.ExcelSheetName = activeSheetName;
                }

                wfv = MainHelper.PlatformSqlMap.GetOne<WF_TableFieldValue>(" where  UserControlId='" + parentTemple.LPID + "'"
                                 + " and   WorkflowId='" + wfv.WorkFlowId + "'"
                                 + " and   RecordId='" + wfv.RecordId + "'"
                                 + " and   UserControlId='" + wfv.UserControlId + "'"
                                 + " and   WorkFlowInsId='" + wfv.WorkFlowInsId + "'"
                                 + " and   fieldname='" + lp.CellName + "'"
                                 + " and   FieldId='" + lp.LPID + "' and Bigdata is not null"
                                );

                dsoFramerWordControl1.FileSave();
                currRecord.DocContent = dsoFramerWordControl1.FileDataGzip;
                if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                if (wfv == null)
                {
                    wfv = new WF_TableFieldValue();
                    wfv.ID = wfv.CreateID();
                    wfv.RecordId = currRecord.ID;
                    wfv.WorkFlowId = WorkFlowData.Rows[0]["WorkFlowId"].ToString();
                    wfv.WorkFlowInsId = WorkFlowData.Rows[0]["WorkFlowInsId"].ToString();
                    wfv.WorkTaskId = WorkFlowData.Rows[0]["WorkTaskId"].ToString();
                    wfv.WorkTaskInsId = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                    wfv.UserControlId = parentTemple.LPID;
                    wfv.ControlValue = "";
                    wfv.FieldId = lp.LPID;
                    wfv.FieldName = lp.CellName;
                    wfv.XExcelPos = GetCellPos(lp.CellPos)[0];
                    wfv.YExcelPos = GetCellPos(lp.CellPos)[1];
                    wfv.ExcelSheetName = activeSheetName;
                    wfv.Bigdata = currRecord.DocContent;
                    MainHelper.PlatformSqlMap.Create<WF_TableFieldValue>(wfv);
                }
                else
                {
                    wfv.Bigdata = currRecord.DocContent;
                    MainHelper.PlatformSqlMap.Update<WF_TableFieldValue>(wfv);

                }
            }
            RunTaskUpdate();
            RunTaskRecordUpdate();
            switch (status)
            {
                case "add":

                    //LP_Record newRecord = new LP_Record();
                    currRecord.Kind = kind;
                    currRecord.Content = GetContent();
                    dsoFramerWordControl1.FileSave();
                    //dsoFramerWordControl1.FileClose();
                    if (ctrlNumber != null)
                        currRecord.Number = ctrlNumber.Text;
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.LastChangeTime = DateTime.Now.ToString();

                    //string[] strtemp = RecordWorkTask.RunNewGZPRecord(currRecord.ID, kind, MainHelper.User.UserID);
                    wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
                    if (wt != null)
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
                    }
                    else
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
                    }
                    //strmes = strtemp[0];
                    //currRecord.Status = strtemp[1];
                    if (strmes.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(strmes);
                    strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                    if (strmes == "结束节点1")
                    {
                        currRecord.Status = "存档";
                    }
                    else
                    {
                        currRecord.Status = strmes;
                    }
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
                    rowData = null;
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                            MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);
                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                            PJ_lcfj lcfu = new PJ_lcfj();
                            lcfu.ID = lcfu.CreateID();
                            lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                            lcfu.FileRelativePath = filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                            lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                            lcfu.RecordID = currRecord.ID;
                            lcfu.Creattime = DateTime.Now;
                            Thread.Sleep((new TimeSpan(100000)));//0.1毫秒
                            if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                                MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                        }

                    }
                    //currRecord = newRecord;
                    break;
                case "edit":

                    currRecord.LastChangeTime = DateTime.Now.ToString();
                    // dsoFramerWordControl1.FileSave();
                    //currRecord.DocContent = this.dsoFramerWordControl1.FileDataGzip;
                    //byte[] bt = new byte[0];
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.Content = GetContent();
                    dsoFramerWordControl1.FileSave();
                    //dsoFramerWordControl1.FileClose();
                    wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
                    if (wt != null)
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
                    }
                    else
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), "提交");
                    }
                    string towho = strmes;
                    strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                    if (strmes.IndexOf("结束节点") > -1)
                    {
                        CurrRecord.Status = "存档";
                    }
                    else
                    {
                        CurrRecord.Status = strmes;
                    }
                    if (towho.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(towho);
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    if (currRecord.ImageAttachment == null) currRecord.ImageAttachment = new byte[0];
                    if (currRecord.SignImg == null) currRecord.SignImg = new byte[0];
                    MainHelper.PlatformSqlMap.Update("UpdateLP_Record", currRecord);
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                            MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);

                    }

                    rowData = null;
                    break;
            }


            this.DialogResult = DialogResult.OK;
        }
예제 #5
0
       public void btn_Submit_Click(object sender, EventArgs e)
        {
            
            if (filecontrol != null)
            {
                if (filecontrol.Isupfile)
                {
                    MsgBox.ShowTipMessageBox("请稍后,正在上传文件");
                    return;
                }
                if (filecontrol.Isdownfile)
                {
                    if (MsgBox.ShowAskMessageBox("正在下载文件,确认提交?") != DialogResult.OK)
                    {
                        return;
                    }

                }
            }
           
          
            switch (status)
            {
                case "add":
                  
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                            MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);
                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                            PJ_lcfj lcfu = new PJ_lcfj();
                            lcfu.ID = lcfu.CreateID();
                            lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                            lcfu.FileRelativePath = filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                            lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                            lcfu.RecordID = currRecord.ID;
                            lcfu.Creattime = DateTime.Now;
                            Thread.Sleep((new TimeSpan(100000)));//0.1毫秒
                            if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                            MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                        }

                    }
                    break;
                case "edit":
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                            MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);

                    }
                    break;
            }
            this.DialogResult = DialogResult.OK;
        }
예제 #6
0
        void btn_Submit_Click(object sender, EventArgs e)
        {
            Excel.Workbook wb;
            Excel.Worksheet sheet;
            wb = dsoFramerWordControl1.AxFramerControl.ActiveDocument as Excel.Workbook;
            sheet = wb.Application.Sheets[1] as Excel.Worksheet;
            if (filecontrol != null)
            {
                if (filecontrol.Isupfile)
                {
                    MsgBox.ShowTipMessageBox("请稍后,正在上传文件");
                    return;
                }
                if (filecontrol.Isdownfile)
                {
                    if (MsgBox.ShowAskMessageBox("正在下载文件,确认提交?") != DialogResult.OK)
                    {
                        return;
                    }

                }
            }
            unLockExcel();
            for (int i = 1;  sheet.Protection.AllowEditRanges.Count>0;)
            {
                Excel.AllowEditRange editRange = sheet.Protection.AllowEditRanges.get_Item(i);
                editRange.Delete()  ;
            }
            LockExcel();
            byte[] bt = new byte[0];
            string strmes = "";
            switch (status)
            {
                case "add":
                    //LP_Record newRecord = new LP_Record();
                    dsoFramerWordControl1.FileSave();
                    currRecord.DocContent = dsoFramerWordControl1.FileDataGzip;
                    currRecord.Kind = kind;
                    currRecord.Content = GetContent();
                    if (ctrlNumber!=null)
                        currRecord.Number = ctrlNumber.Text;
                    if (ctrlNumber != null)
                        currRecord.OrgName = ctrlOrgName.Text;
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.CreateTime = DateTime.Now.ToString();

                    string[] strtemp = RecordWorkTask.RunNewGZPRecord(currRecord.ID, kind, MainHelper.User.UserID);
                    strmes = strtemp[0];
                    currRecord.Status = strtemp[1];
                    if (strmes.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(strmes);

                    MainHelper.PlatformSqlMap.Create<LP_Record>(currRecord);
                    rowData = null;
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        WorkFlowData = RecordWorkTask.GetRecordWorkFlowData(currRecord.ID, MainHelper.User.UserID);
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text!="")
                        MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);
                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                            PJ_lcfj lcfu = new PJ_lcfj();
                            lcfu.ID = lcfu.CreateID();
                            lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                            lcfu.FileRelativePath = filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                            lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                            lcfu.RecordID = currRecord.ID;
                            lcfu.Creattime = DateTime.Now;
                            Thread.Sleep((new TimeSpan(100000)));//0.1毫秒
                            if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                            MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                        }

                    }
                    //currRecord = newRecord;
                    break;
                case "edit":
                    currRecord.LastChangeTime = DateTime.Now.ToString();
                    if (ctrlNumber != null)
                        currRecord.OrgName = ctrlOrgName.Text;
                    dsoFramerWordControl1.FileSave();
                    currRecord.DocContent = this.dsoFramerWordControl1.FileDataGzip;
                    //byte[] bt = new byte[0];
                    //currRecord.ImageAttachment = bt;
                    //currRecord.SignImg = bt;
                    currRecord.Content = GetContent();
                    WF_WorkTaskCommands wt = (WF_WorkTaskCommands)MainHelper.PlatformSqlMap.GetObject("SelectWF_WorkTaskCommandsList", " where WorkFlowId='" + WorkFlowData.Rows[0]["WorkFlowId"].ToString() + "' and WorkTaskId='" + WorkFlowData.Rows[0]["WorkTaskId"].ToString() + "'");
                    if (wt != null)
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(), wt.CommandName);
                    }
                    else
                    {
                        strmes = RecordWorkTask.RunWorkFlow(MainHelper.User.UserID, WorkFlowData.Rows[0]["OperatorInsId"].ToString(), WorkFlowData.Rows[0]["WorkTaskInsId"].ToString(),  "提交");
                    }
                    if (strmes.IndexOf("未提交至任何人") > -1)
                    {
                        MsgBox.ShowTipMessageBox("未提交至任何人,创建失败,请检查流程模板和组织机构配置是否正确!");
                        return;
                    }
                    else
                        MsgBox.ShowTipMessageBox(strmes);
                    strmes = RecordWorkTask.GetWorkFlowTaskCaption(WorkFlowData.Rows[0]["WorkTaskInsId"].ToString());
                    if (hqyjcontrol != null)
                    {
                        PJ_lcspyj lcyj = new PJ_lcspyj();
                        lcyj.Charman = MainHelper.User.UserName;
                        lcyj.ID = PJ_lcspyj.Newid();
                        lcyj.RecordID = currRecord.ID;
                        lcyj.taskID = WorkFlowData.Rows[0]["WorkTaskInsId"].ToString();
                        lcyj.Spyj = hqyjcontrol.nowMemoEdit.Text;
                        lcyj.Creattime = DateTime.Now;
                        if (hqyjcontrol.nowMemoEdit.Text != "")
                        MainHelper.PlatformSqlMap.Create<PJ_lcspyj>(lcyj);

                    }
                    if (filecontrol != null)
                    {
                        for (int i = 0; i < filecontrol.FJtable.Rows.Count; i++)
                        {

                            PJ_lcfj lcfu = new PJ_lcfj();
                            lcfu.ID = lcfu.CreateID();
                            lcfu.Filename = Path.GetFileName(filecontrol.FJtable.Rows[i]["FilePath"].ToString());
                            lcfu.FileRelativePath = filecontrol.UpfilePath + "/" + filecontrol.FJtable.Rows[i]["SaveFileName"].ToString();
                            lcfu.FileSize = Convert.ToInt64(filecontrol.FJtable.Rows[i]["FileSize"]);
                            lcfu.RecordID = currRecord.ID;
                            lcfu.Creattime = DateTime.Now;
                            if (filecontrol.FJtable.Rows[i]["Kind"].ToString() != "已上传")
                            MainHelper.PlatformSqlMap.Create<PJ_lcfj>(lcfu);
                        }

                    }
                    if (strmes == "结束节点1")
                    {
                        CurrRecord.Status = "存档";
                    }
                    else
                    {
                        CurrRecord.Status = strmes;
                    }
                    if (strmes == "结束节点1")
                    {
                        CurrRecord.Status = "存档";
                    }
                    else
                    {
                        CurrRecord.Status = strmes;
                    }
                    MainHelper.PlatformSqlMap.Update("UpdateLP_Record",CurrRecord);
                    rowData = null;                   
                    break;
            }
            this.DialogResult = DialogResult.OK;
        }