Beispiel #1
0
        public List <ApproverModel> GetListApprover(int?page, string SearchData, int PageSize = PagerModel.PageSize)
        {
            List <ApproverModel> listAM = new List <ApproverModel>();
            DataTable            dt     = new DataTable();
            string tempStr = "SELECT a.*,b.BUName FROM Approver a, BU b WHERE a.BUID=b.BUID";

            if (!string.IsNullOrEmpty(SearchData))
            {
                tempStr += " AND (a.ApproverEmpNo LIKE N'%" + SearchData + "%' OR a.ApproverEmpName LIKE N'%" + SearchData + "%')";
            }
            SQLServerDBHelper db = new SQLServerDBHelper("EsignDB");

            if (page != null)
            {
                dt = db.DoSQLSelect(tempStr, page, PageSize);
            }
            else
            {
                dt = db.DoSQLSelect(tempStr);
            }

            foreach (DataRow dr in dt.Rows)
            {
                listAM.Add(new ApproverModel(dr["ApproverID"].ToString(), dr["SiteID"].ToString(), dr["BUID"].ToString(), dr["BUName"].ToString(), dr["ApproverType"].ToString(), dr["ApproverEmpNo"].ToString(), dr["ApproverEmpName"].ToString(), dr["SetupEmp"].ToString(), dr["SetupTime"].ToString()));
            }
            return(listAM);
        }
 public DataTable tBleForm(string formName)
 {
     DataTable table = new DataTable();
     string strQuery = @"select * from Forms where formName='"+formName+"' ";
     table = sqlHelp.DoSQLSelect(strQuery);           
     return table;
 }
        public bool checkSignProcess(int formID, string appNo)
        {
            try
            {
                DataTable tb       = new DataTable();
                string    sqlQuery = @"select * from SubmitSign where FormID = '" + formID + "' order by SignNo asc ";

                tb = sqlHelp.DoSQLSelect(sqlQuery);
                if (tb.Rows.Count > 0)
                {
                    bool   kq     = true;
                    string status = "";
                    int    step   = 0;
                    for (int i = 0; i < tb.Rows.Count; i++)
                    {
                        status = tb.Rows[i]["SignName"].ToString();
                        step   = i;
                        kq     = insertSchedule(appNo, status, step);
                        if (kq == false)
                        {
                            break;
                        }
                    }
                    return(kq);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                return(false);
            }
        }
    public static DataTable GetListLanguage(int _startIndex, int _pageNumberRow)
    {
        DataTable         dt      = new DataTable();
        SQLServerDBHelper db      = new SQLServerDBHelper("EsignDB");
        string            tempStr = "SELECT * FROM Languages";

        dt = db.DoSQLSelect(tempStr, _startIndex, _pageNumberRow);
        return(dt);
    }
    public static DataTable GetListLanguage()
    {
        DataTable         dt      = new DataTable();
        SQLServerDBHelper db      = new SQLServerDBHelper("EsignDB");
        string            tempStr = "SELECT * FROM Languages";

        dt = db.DoSQLSelect(tempStr);
        return(dt);
    }
        public DataTable getListResource(string _languageId, int _start, int _pageSize)
        {
            DataTable         dt      = new DataTable();
            string            tempStr = "SELECT * FROM Resources WHERE languageId='" + _languageId + "'";
            SQLServerDBHelper db      = new SQLServerDBHelper("EsignDB");

            dt = db.DoSQLSelect(tempStr, _start, _pageSize);
            return(dt);
        }
Beispiel #7
0
    public static List <BusinessUnitModel> GetListBU(string SiteID)
    {
        string            tempStr = "SELECT * FROM BU";
        SQLServerDBHelper db      = new SQLServerDBHelper("EsignDB");
        DataTable         dt      = db.DoSQLSelect(tempStr);

        if (!string.IsNullOrWhiteSpace(SiteID))
        {
            tempStr += " WHERE SiteID='" + SiteID + "'";
        }
        dt = db.DoSQLSelect(tempStr);
        List <BusinessUnitModel> ListBU = new List <BusinessUnitModel>();

        foreach (DataRow dr in dt.Rows)
        {
            ListBU.Add(new BusinessUnitModel(dr["BUID"].ToString().Trim(), dr["BUName"].ToString().Trim()));
        }
        return(ListBU);
    }
Beispiel #8
0
        public DataTable listFormContent(int formID)
        {
            SQLServerDBHelper sqlHelper = new SQLServerDBHelper();
            DataTable         tb        = new DataTable();

            //sqlHelper.DoSQLSelect
            string sqlQuery = @"select * from FormContent where FormID =" + formID + "";

            tb = sqlHelper.DoSQLSelect(sqlQuery);
            return(tb);
        }
        public JsonResult GetListBu(string site)
        {
            var listBU           = new List <Tuple <string, string> >();
            SQLServerDBHelper db = new SQLServerDBHelper("EsignDB");
            DataTable         dt = db.DoSQLSelect("SELECT * FROM BU WHERE SiteID='" + site.Trim() + "'");

            foreach (DataRow dr in dt.Rows)
            {
                listBU.Add(Tuple.Create(dr["BUID"].ToString().Trim(), dr["BUName"].ToString().Trim()));
            }
            return(Json(listBU, JsonRequestBehavior.AllowGet));
        }
        public JsonResult GetListSite()
        {
            var listSite         = new List <Tuple <string, string> >();
            SQLServerDBHelper db = new SQLServerDBHelper("EsignDB");
            DataTable         dt = db.DoSQLSelect("SELECT * FROM Site");

            foreach (DataRow dr in dt.Rows)
            {
                listSite.Add(Tuple.Create(dr["SiteID"].ToString().Trim(), dr["SiteName"].ToString().Trim()));
            }
            return(Json(listSite, JsonRequestBehavior.AllowGet));
        }
    public static bool Login(string _userId, string _password)
    {
        SQLServerDBHelper db      = new SQLServerDBHelper("ESign");
        string            tempSQL = "SELECT * FROM Account UserID='" + _userId + "' AND Password='******'";
        DataTable         dt      = db.DoSQLSelect(tempSQL);

        if (dt != null && dt.Rows.Count > 0)
        {
            Login(dt.Rows[0]["UserID"].ToString(), dt.Rows[0]["Username"].ToString(), dt.Rows[0]["Permission"].ToString());
            return(true);
        }
        return(false);
    }
Beispiel #12
0
    public static List <string> GetListType()
    {
        SQLServerDBHelper db       = new SQLServerDBHelper("EsignDB");
        string            tempStr  = "SELECT ApproverTypeID FROM ApproverType";
        DataTable         dt       = db.DoSQLSelect(tempStr);
        List <string>     ListType = new List <string>();

        foreach (DataRow dr in dt.Rows)
        {
            ListType.Add(dr[0].ToString().Trim());
        }
        return(ListType);
    }
Beispiel #13
0
    public static List <SiteModel> GetListSite()
    {
        SQLServerDBHelper db       = new SQLServerDBHelper("EsignDB");
        string            tempStr  = "SELECT * FROM Site";
        DataTable         dt       = db.DoSQLSelect(tempStr);
        List <SiteModel>  ListSite = new List <SiteModel>();

        foreach (DataRow dr in dt.Rows)
        {
            ListSite.Add(new SiteModel(dr["SiteID"].ToString().Trim(), dr["SiteName"].ToString().Trim()));
        }
        return(ListSite);
    }
        public bool IsExistResource(string _languageId, string _resourceName)
        {
            SQLServerDBHelper db       = new SQLServerDBHelper("EsignDB");
            string            checkSql = "SELECT * FROM Resources WHERE languageId='" + _languageId.Trim() + "' AND resourceName='" + _resourceName.Trim() + "'";
            DataTable         dt       = db.DoSQLSelect(checkSql);

            if (dt.Rows.Count > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #15
0
        public ApproverDetailModel GetApproverDetail(string ApproverID)
        {
            ApproverDetailModel adm   = new ApproverDetailModel();
            string            tempStr = "SELECT * FROM Approver WHERE ApproverID='" + ApproverID + "'";
            SQLServerDBHelper db      = new SQLServerDBHelper("EsignDB");
            DataTable         dt      = db.DoSQLSelect(tempStr);

            adm.ApproverModel = new ApproverModel();
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                adm.ApproverModel = new ApproverModel(dr["ApproverID"].ToString(), dr["SiteID"].ToString().Trim(), dr["BUID"].ToString(), "", dr["ApproverType"].ToString().Trim(), dr["ApproverEmpNo"].ToString().Trim(), dr["ApproverEmpName"].ToString().Trim(), dr["SetupEmp"].ToString().Trim(), dr["SetupTime"].ToString());
                adm.SelectedSite  = dr["SiteID"].ToString().Trim();
                adm.SelectedBU    = dr["BUID"].ToString().Trim();
                adm.SelectedType  = dr["ApproverType"].ToString().Trim();
            }
            RepairSelectListModel(adm);
            return(adm);
        }
        public bool insertSenmail(string empNo, string orderNo, string conten, string appliCant, string notes)
        {
            try
            {
                PostmanService.PostmanServiceSoapClient postman = new PostmanService.PostmanServiceSoapClient();
                DataTable tableEmp = postman.GetEmpInfomation(empNo);
                string    userName = tableEmp.Rows[0]["USER_NAME"].ToString();
                string    mailTo   = nCode.getMailAccount(empNo);
                if (mailTo != null || mailTo != "")
                {
                    mailTo = tableEmp.Rows[0]["NOTES_ID"].ToString();
                    if (mailTo.Equals("") || mailTo == null)
                    {
                        mailTo = ",";
                    }
                }

                Random    newRan    = new Random();
                int       num       = newRan.Next(1, 1000);
                string    ran       = Convert.ToString(num);
                string    id        = DateTime.Now.ToString("yyyyMMddHHmmss") + ran;
                DataTable tableEmp2 = postman.GetEmpInfomation(appliCant);
                string    userName2 = tableEmp2.Rows[0]["USER_NAME"].ToString();
                string    copyto    = "";

                string    sqlQueryLink = @"select * from link_formSign where linkNameTrim = '" + conten.Trim() + "'";
                DataTable tbLink       = sqlDBEsign.DoSQLSelect(sqlQueryLink);
                string    conte        = conten;
                string    linkForm     = "";

                if (tbLink.Rows.Count > 0)
                {
                    linkForm = tbLink.Rows[0]["linkSign"].ToString();
                }
                else
                {
                    linkForm = "http://10.224.81.136:8686/Employee/ApplicationIT/formSign?appNo=";
                }


                string fla       = "0";
                string mailTitle = userName + " , 您好, 《Esign-system 2.0》" + notes + " ! 單據名稱: " + conte + " , 申請人: " + userName2 + " ,申請單號:" + orderNo;
                string mailBody1 = "\n《Esign-system 2.0》文件電子簽核申請信息,申請單號: " + orderNo;
                string mailBody2 = "系統網址(web site): http://10.224.81.136:8686/";
                string mailBody3 = "\n單據簽核連接(web site of approve): " + linkForm + orderNo;
                string mailBody4 = "\n";
                string mailBody5 = @"\n基本操作說明(Basic operating instructions):
1.點擊系統網址後會出現登錄畫面(使用域帳號登錄[開機帳號 + 開機密碼]).
 --enter the login page, key in your computer account / your computer password.
2.進入系統界面後,即可選擇申請單號進行簽核.

--login system select apply number to approve.
3.若沒有賬號請先註冊您的賬號,待審核審核通過即可登錄使用.
--If you don't have an account, please register your account first, and you can login to use after being approved.
基本操作說明:
                1.點擊系統網址後會出現登錄畫面()
     (1)若沒有手動註冊過,則初始賬號和密碼均為工號,該頁面權限已自動開通,無需聯繫系統管理員
     (2)若無法登錄,請注意查看系統提示信息,詳情如下:
         a)若提示沒有賬號,則請自行註冊(若有[新版]和[舊版],請點擊[舊版]進行註冊),註冊成功后再郵件通知系統管理員去開通權限或註冊時自動選擇相應權限(步驟:點擊[自助選擇權限]--》彈出的頁面中選擇相應權限)
         b)若提示沒有權限,則請郵件通知系統管理員去開通權限
         c)若提示密碼不對,則請重置開機密碼
         c)若提示賬號被鎖,則請點擊[忘記密碼] 自行解鎖
    2.進入系統界面後﹐即可選擇申請單號.
    3.系統管理員聯繫方式在系統登錄頁面,請自行查找(若有[新版]和[舊版],請點擊[舊版]進行查找).
";
                string mailBody6 = "IT聯絡信息 (Ext:535-27847/27123 Mail:[email protected])";
                string mailBody  = string.Format(@"{0}
{1}
{2} 
{3} 
{4} 
{5}
{6}", mailBody1.PadLeft(4), mailBody2.PadLeft(4), mailBody3.PadLeft(4), mailBody4.PadLeft(4), mailBody5.PadLeft(4), mailBody6.PadLeft(4), DateTime.Now.ToString().PadLeft(4));

                string title2   = mailTitle;
                string sqlQuery = @"insert into sendm(id,sendto,copyto,title,body,flag) values (@id,@sendto,@copyto,@title,@body,@flag) ;";

                SqlParameter[] param = new SqlParameter[6];

                param.SetValue(new SqlParameter("id", id), 0);
                param.SetValue(new SqlParameter("sendto", mailTo), 1);
                param.SetValue(new SqlParameter("copyto", copyto), 2);
                param.SetValue(new SqlParameter("title", title2), 3);
                param.SetValue(new SqlParameter("body", mailBody), 4);
                param.SetValue(new SqlParameter("flag", fla), 5);

                bool kr = sqlDB.ExcuteNonQuery(sqlQuery, param);

                return(kr);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #17
0
        public ActionResult SetUpSigner(FORM_IT_01Model reqModel, string Approval)
        {
            setViewDepartment();
            var session = (UserLogin)Session[CommonConstants.USER_SESSION];
            var emp     = session.UserID.Trim();

            if (ModelState.IsValid)
            {
                switch (Approval)
                {
                case "Next":
                {
                    if (emp == "V0957033")
                    {
                        if (reqModel.Title2 == "FORM_HR_01" || reqModel.Title2 == "FORM_HR_02")
                        {
                            reqModel.Title1Example = "Tieptheo";
                            string    strQuery = @"select * from Forms where formName = '" + reqModel.Title2.Trim() + "' ;";
                            DataTable tb       = new DataTable();
                            tb = sqlHelp.DoSQLSelect(strQuery);
                            if (tb.Rows.Count > 0)
                            {
                                int       formD         = Convert.ToInt32(tb.Rows[0]["FormID"].ToString());
                                string    sqlQuery1     = @"select * from SubmitSign where FormID = '" + formD + "' order by SignNo asc";
                                DataTable tbSignProcess = new DataTable();
                                tbSignProcess = sqlHelp.DoSQLSelect(sqlQuery1);
                                string signEm   = "";
                                string SignNa   = "";
                                string statusNa = "";
                                int    step1    = 0;
                                //string agent = "";
                                List <ApprovalAppModel> listAppro = new List <ApprovalAppModel>();

                                if (tbSignProcess.Rows.Count > 0)
                                {
                                    for (int i = 0; i < tbSignProcess.Rows.Count; i++)
                                    {
                                        step1    = i;
                                        statusNa = tbSignProcess.Rows[i]["SignName"].ToString();

                                        listAppro.Add(new ApprovalAppModel
                                            {
                                                step       = step1,
                                                statusName = statusNa,
                                                signEmpNo  = "",
                                                SignName   = ""
                                            });
                                    }
                                }
                                reqModel.approvalApps  = listAppro;
                                reqModel.Title3Example = tb.Rows[0]["FormID"].ToString();
                            }
                        }
                    }
                    else
                    {
                    }
                    break;
                }

                case "Return":
                {
                    reqModel.Title1Example = "khongthayduoc";
                    break;
                }

                case "submit_ok":
                {
                    var      pSelect    = Request.Form["testKQ"].ToString();
                    string[] signSelect = pSelect.Split(',');
                    signSelect = signSelect.Where(x => !string.IsNullOrEmpty(x)).ToArray();

                    string strQueryDel = @"delete SubmitSign where FormID='" + reqModel.Title3Example + "';";
                    sqlHelp.ExcuteNonQuery(strQueryDel);
                    int  formS     = 32;
                    bool checkFlag = false;

                    for (int i = 0; i < signSelect.Length; i++)
                    {
                        string strInsert = @"insert into SubmitSign(FormID,SignNo,SignName) values ('" + formS + "','" + i + "',N'" + signSelect[i].ToString() + "') ;";
                        checkFlag = sqlHelp.ExcuteNonQuery(strInsert);
                        if (checkFlag == false)
                        {
                            break;
                        }
                    }
                    if (checkFlag)
                    {
                        reqModel.Title1Example = "thanhcong";
                    }
                    else
                    {
                        reqModel.Title1Example = "thatbai";
                    }
                    break;
                }
                }
            }
            return(View(reqModel));
        }
Beispiel #18
0
        public FORM_IT_01Model requestModelReg(string appNo)
        {
            FORM_IT_01Model conModel = new FORM_IT_01Model();

            try
            {
                //            AppNo,EmpNo,Name,NumPhone,Site,BU,
                //    Depart,Mail,CodeCost,OfficeFac,Location,MacAd,ComputerSpeci,ComputerBrand,
                //KindofPC,AssetCode,TimeStart,TimeEnd,ApplicationType,ComputerName,IPAdd,SeriNum,ColorPC,
                //LocationApply,filePath,fileName,Reason,USB_Read,FactoryApply

                string    sqlQuery = @"select * from RegisterAccount where AppNoReg='" + appNo + "' ";
                DataTable table    = new DataTable();

                table = db.DoSQLSelect(sqlQuery);
                if (table.Rows.Count > 0)
                {
                    conModel.empID         = table.Rows[0]["EmpID"].ToString();
                    conModel.empName       = table.Rows[0]["EmpName"].ToString();
                    conModel.Title3Content = table.Rows[0]["EmpDePart"].ToString();
                    conModel.Title2Content = table.Rows[0]["EmpPhone"].ToString();
                    conModel.Title6        = table.Rows[0]["EmpCost"].ToString();
                    conModel.AppNo         = table.Rows[0]["AppNoReg"].ToString();

                    conModel.Title1Content  = table.Rows[0]["EmpMail"].ToString();
                    conModel.Title15Content = table.Rows[0]["EmpSys"].ToString();
                    conModel.Title4Content  = table.Rows[0]["EmpRole"].ToString();
                    conModel.Title14Content = table.Rows[0]["EmpFac"].ToString();
                    conModel.Title5Content  = table.Rows[0]["EmpLocation"].ToString();



                    if (conModel.Title4Content.Contains("USER"))
                    {
                        conModel.role11 = true;
                    }
                    if (conModel.Title4Content.Contains("MANAGERMENT"))
                    {
                        conModel.role12 = true;
                    }
                    if (conModel.Title4Content.Contains("ITNETWORK"))
                    {
                        conModel.role13 = true;
                    }
                    if (conModel.Title4Content.Contains("ITMANAGER"))
                    {
                        conModel.role14 = true;
                    }



                    // list sign
                    string sqlQuerySign = @"SELECT step,statusName,SignName,signEmpNo,fowardInfo,(select top 1 approvalname from approvalsuggest where orderNo=a.AppNo and statusname=a.statusname and stt = a.step and (approvalid = a.signEmpNo or approvalid=a.signOver) order by approvaltime desc ) approvalname,  " +
                                          " (select top 1 status from approvalsuggest where orderNo = a.AppNo and statusname = a.statusname and stt = a.step and(approvalid = a.signEmpNo or approvalid = a.signOver) order by approvaltime desc ) status,  " +
                                          " (select top 1 approvalsuggest from approvalsuggest where orderNo = a.AppNo and statusname = a.statusname and stt = a.step  and(approvalid = a.signEmpNo or approvalid = a.signOver) order by approvaltime desc ) approvalsuggest,  " +
                                          " (select top 1 approvaltime from approvalsuggest where orderNo = a.AppNo and statusname = a.statusname and stt = a.step and(approvalid = a.signEmpNo or approvalid = a.signOver) order by approvaltime desc ) approvaltime " +
                                          " FROM approvalSchedule a " +
                                          " where a.AppNo = '" + appNo + "' " +
                                          " order by CONVERT(int, step); ";
                    DataTable tb2 = db.DoSQLSelect(sqlQuerySign);
                    if (tb2.Rows.Count > 0)
                    {
                        List <ApprovalAppModel> listApprovals = new List <ApprovalAppModel>();
                        for (int i = 0; i < tb2.Rows.Count; i++)
                        {
                            string dateQue = tb2.Rows[i]["approvaltime"].ToString();
                            if (dateQue.Equals(""))
                            {
                                listApprovals.Add(
                                    new ApprovalAppModel
                                {
                                    step            = i,
                                    statusName      = tb2.Rows[i]["statusName"].ToString(),
                                    signEmpNo       = tb2.Rows[i]["signEmpNo"].ToString(),
                                    SignName        = tb2.Rows[i]["SignName"].ToString(),
                                    approvalsuggest = tb2.Rows[i]["approvalsuggest"].ToString(),
                                    status          = tb2.Rows[i]["status"].ToString(),
                                    approvaltime    = null,
                                    fowardInfo      = tb2.Rows[i]["fowardInfo"].ToString()
                                }
                                    );
                            }
                            else
                            {
                                listApprovals.Add(
                                    new ApprovalAppModel
                                {
                                    step            = i,
                                    statusName      = tb2.Rows[i]["statusName"].ToString(),
                                    signEmpNo       = tb2.Rows[i]["signEmpNo"].ToString(),
                                    SignName        = tb2.Rows[i]["SignName"].ToString(),
                                    approvalsuggest = tb2.Rows[i]["approvalsuggest"].ToString(),
                                    status          = tb2.Rows[i]["status"].ToString(),
                                    approvaltime    = DateTime.Parse(dateQue),
                                    fowardInfo      = tb2.Rows[i]["fowardInfo"].ToString()
                                }
                                    );
                            }
                        }
                        conModel.approvalApps = listApprovals;
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
            }

            return(conModel);
        }
        //lay du lieu trang ky don
        private ApprovalApp getApprovalApp(string appNo)
        {
            ApprovalApp       aprApp    = new ApprovalApp();
            string            sqlQuery  = @"select * from APPROVE_SIGN where APPNO = '" + appNo + "'";
            SQLServerDBHelper dBHelper  = new SQLServerDBHelper("EsignDB");
            DataTable         tb        = dBHelper.DoSQLSelect(sqlQuery);
            string            sqlQuery1 = @"select * from DATA_APP_ESIGN where APPNO = '" + appNo + "'";
            DataTable         tb1       = dBHelper.DoSQLSelect(sqlQuery1);
            //aprApp.EmpModels = new EmpModel();
            // don nguoi dung lam
            EmpModel empM = new EmpModel();

            if (tb1.Rows.Count > 0)
            {
                DataRow dr1 = tb1.Rows[0];
                empM.APPSTATES      = dr1["APPSTATES"].ToString();
                empM.APPNO          = dr1["APPNO"].ToString();
                empM.Checkwait      = dr1["Checkwait"].ToString();
                empM.ApplicantNo    = dr1["ApplicantNo"].ToString();
                empM.ApplicantName  = dr1["ApplicantName"].ToString();
                empM.ApplicantCode  = dr1["ApplicantCode"].ToString();
                empM.ApplicantMail  = dr1["ApplicantMail"].ToString();
                empM.ApplicantPhone = dr1["ApplicantPhone"].ToString();
                empM.ApplicantDep   = dr1["ApplicantDep"].ToString();
                empM.Recipientunit  = dr1["Recipientunit"].ToString();
                empM.Organizer      = dr1["Organizer"].ToString();
                empM.Copysubmission = dr1["Copysubmission"].ToString();
                empM.Page           = dr1["Page"].ToString();
                empM.Issuer         = dr1["Issuer"].ToString();
                empM.Documentnumber = dr1["Documentnumber"].ToString();
                empM.Daycreate      = dr1["Daycreate"].ToString();
                empM.Title          = dr1["Title"].ToString();
                empM.AppContent     = dr1["AppContent"].ToString();
                empM.FileName       = dr1["FileName"].ToString();
                empM.Signer3No      = dr1["Signer3No"].ToString();
                empM.Signer3Name    = dr1["Signer3Name"].ToString();
                empM.Signer4No      = dr1["Signer4No"].ToString();
                empM.Signer4Name    = dr1["Signer4Name"].ToString();
                empM.Signer5No      = dr1["Signer5No"].ToString();
                empM.Signer5Name    = dr1["Signer5Name"].ToString();
                empM.Signer6No      = dr1["Signer6No"].ToString();
                empM.Signer6Name    = dr1["Signer6Name"].ToString();
                empM.Username       = dr1["USERNAME"].ToString();
                //empM.FileContent = dr1["FileContent"].ToString();
                //empM.FileContent = Convert.ToByte(dr1["FileContent"].);
            }
            List <APPROVE_SIGN> list_A = new List <APPROVE_SIGN>();
            long     approveID         = 0;
            string   appID             = "";
            string   approverName      = "";
            string   approverNo        = "";
            string   processName       = "";
            DateTime time    = DateTime.Now;
            string   note    = "";
            string   status  = "";
            string   agentIP = "";
            string   agent   = "";

            if (tb.Rows.Count > 0)
            {
                //DataRow dr = tb.Rows[0];
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    //approveID = Convert.ToInt32(tb.Rows[i]["APPROVEID"].ToString());
                    appID        = tb.Rows[i]["APPNO"].ToString();
                    approverName = tb.Rows[i]["APPROVERNAME"].ToString();
                    approverNo   = tb.Rows[i]["APPROVEREMP"].ToString();
                    processName  = tb.Rows[i]["PROCESSNAME"].ToString();
                    note         = tb.Rows[i]["NOTES"].ToString();
                    status       = tb.Rows[i]["STATUS"].ToString();
                    time         = Convert.ToDateTime(tb.Rows[i]["TIMEAPPROVE"].ToString());
                    //agentIP = tb.Rows[i]["AGENTEMP"].ToString();
                    //agent = tb.Rows[i]["AGENTNAME"].ToString();
                    list_A.Add(new APPROVE_SIGN
                    {
                        APPROVEID    = approveID,
                        APPNO        = appID,
                        APPROVERNAME = approverName,
                        APPROVEREMP  = approverNo,
                        PROCESSNAME  = processName,
                        NOTES        = note,
                        STATUS       = status,
                        TIMEAPPROVE  = time
                                       //AGENTEMP = agentIP,
                                       //AGENTNAME = agent
                    });
                }
            }
            aprApp.APPROVEs  = list_A;
            aprApp.EmpModels = empM;

            return(aprApp);
        }
        // [OutputCache(Location = System.Web.UI.OutputCacheLocation.Server, Duration = 3600 * 24, VaryByParam = "None")]
        public ActionResult FORM_IT_01()
        {
            FORM_IT_01Model formIT01 = new FORM_IT_01Model();
            var             formID   = "FORM_IT_01";
            var             newCode  = new NewCode();

            if (formID == null)
            {
                return(RedirectToAction(""));
            }


            formIT01.FormID = newCode.getFormID(formID);
            string    sqlQuery  = @"select * from TitleForm where FormID = '" + formIT01.FormID + "'";
            DataTable dataTitle = new DataTable();

            dataTitle = dbHelpers.DoSQLSelect(sqlQuery);
            string titleBu = "";
            string titleEx = "";

            if (dataTitle.Rows.Count > 0)
            {
                for (int i = 0; i < dataTitle.Rows.Count; i++)
                {
                    titleBu += dataTitle.Rows[i]["FormContent"].ToString() + ";";
                    titleEx += dataTitle.Rows[i]["Example"].ToString() + ";";
                }
            }

            // gan gia tri cho list signer
            string    sqlQuery1     = @"select * from SubmitSign where FormID = '" + formIT01.FormID + "' order by SignNo asc";
            DataTable tbSignProcess = new DataTable();

            tbSignProcess = dbHelpers.DoSQLSelect(sqlQuery1);
            string signEm   = "";
            string SignNa   = "";
            string statusNa = "";
            int    step1    = 0;
            //string agent = "";
            List <ApprovalAppModel> listAppro = new List <ApprovalAppModel>();


            if (tbSignProcess.Rows.Count > 0)
            {
                for (int i = 0; i < tbSignProcess.Rows.Count; i++)
                {
                    step1    = i;
                    statusNa = tbSignProcess.Rows[i]["SignName"].ToString();

                    listAppro.Add(new ApprovalAppModel
                    {
                        step       = step1,
                        statusName = statusNa,
                        signEmpNo  = "",
                        SignName   = ""
                    });
                }
            }

            formIT01.approvalApps = listAppro;
            // gan gia tri  cho title
            string[] titleList = titleBu.Split(';');

            formIT01.Title0 = titleList[0];
            formIT01.Title1 = titleList[1];
            formIT01.Title2 = titleList[2];
            formIT01.Title3 = titleList[3];
            formIT01.Title4 = titleList[4];

            formIT01.Title5 = titleList[5];
            formIT01.Title6 = titleList[6];
            formIT01.Title7 = titleList[7];
            formIT01.Title8 = titleList[8];
            formIT01.Title9 = titleList[9];

            formIT01.Title10 = titleList[10];
            formIT01.Title11 = titleList[11];
            formIT01.Title12 = titleList[12];
            formIT01.Title13 = titleList[13];
            formIT01.Title14 = titleList[14];

            formIT01.Title15 = titleList[15];
            formIT01.Title16 = titleList[16];
            formIT01.Title17 = titleList[17];
            formIT01.Title18 = titleList[18];
            formIT01.Title19 = titleList[19];

            formIT01.Title20 = titleList[20];
            formIT01.Title21 = titleList[21];
            formIT01.Title22 = titleList[22];
            formIT01.Title23 = titleList[23];
            formIT01.Title24 = titleList[24];

            formIT01.Title25 = titleList[25];

            formIT01.Title26 = titleList[26];

            string[] exampleList = titleEx.Split(';');
            formIT01.Title0Example = exampleList[0];
            formIT01.Title1Example = exampleList[1];
            formIT01.Title5Example = exampleList[5];
            formIT01.Title7Example = exampleList[7];
            formIT01.Title8Example = exampleList[8];

            formIT01.Title10Example = exampleList[10];
            formIT01.Title11Example = exampleList[11];
            formIT01.Title12Example = exampleList[12];
            formIT01.Title13Example = exampleList[13];
            formIT01.Title14Example = exampleList[14];
            formIT01.Title15Example = exampleList[15];
            formIT01.Title16Example = exampleList[16];
            formIT01.Title17Example = exampleList[17];

            formIT01.Title26Example = exampleList[26];



            var session = (UserLogin)Session[CommonConstants.USER_SESSION];

            formIT01.Title3Content = session.UserName.ToString();
            formIT01.Title4Content = session.UserID.ToString();

            PostmanService.PostmanServiceSoapClient postman = new PostmanService.PostmanServiceSoapClient();
            DataTable tbPost = new DataTable();

            tbPost = postman.GetEmpInfomation(formIT01.Title4Content.Trim());

            formIT01.Title17Content = tbPost.Rows[0]["NOTES_ID"].ToString();
            formIT01.Title1Content  = tbPost.Rows[0]["CURRENT_OU_NAME"].ToString();
            if (formIT01.Title17Content == null || formIT01.Title17Content == "")
            {
                formIT01.Title17Content = "";
            }
            //formIT01.titleName = titleList;
            setViewFac();
            var a = titleList.Count();

            return(View(formIT01));
        }