protected void Page_Load(object sender, EventArgs e)
    {
        string    action = Request.Form["action"] ?? "";
        JsonReply jr     = new JsonReply();

        try
        {
            if (action == "IsRepeatNo")
            {
                jr.Content = "repeat";
                jr.RetCode = 0;
                int CaseID;
                int.TryParse(Request.Form["CaseID"], out CaseID);
                string IdNo = Request.Form["IdNo"] ?? "";
                if (Convert.ToInt32(DBUtil.DBOp("ConnDB", " SELECT  count([CaseID])  FROM [dbo].[C_CaseUser] where [CaseID]!={0} and IdNo={1}"
                                                , new string[] { CaseID.ToString(), IdNo }, NSDBUtil.CmdOpType.ExecuteScalar)) == 0)
                {
                    jr.Content = " not repeat";
                    jr.RetCode = 1;
                }
            }
        }
        catch {
            jr.RetCode = 0;
        }

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(jr));
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        int CaseID;

        int.TryParse(Request.Form["CaseID"], out CaseID);

        Response.ContentType = "application/json; charset=utf-8";
        if (CaseID != 0)
        {
            DataTable dt = (DataTable)DBUtil.DBOp("ConnDB", " exec dbo.usp_CaseUser_xGetCaseUserContactListSelect {0} "
                                                  , new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(dt));
        }
        else
        {
            //從session撈
            if (Session["NewCaseContacts"] != null)
            {
                DataTable dt = (DataTable)DBUtil.DBOp("ConnDB", " exec dbo.usp_CaseUser_xGetCaseUserContactListSelectTemp {0} "
                                                      , new string[] { Session["NewCaseContacts"].ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

                Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(dt));
            }
        }
        //Response.Write("NewCaseContacts=" + Session["NewCaseContacts"].ToString ());

        Response.End();
    }
Exemple #3
0
    public int Add()
    {
        int NewID = 0;

        try
        {
            NewID = Convert.ToInt32(

                DBUtil.DBOp("ConnDB",
                            "exec dbo.usp_CaseUser_xAddContactRelationShip {0},{1},{2},{3},{4}  ",
                            new string[] {
                CaseID.ToString()
                , RelationShip.ToString()
                , ContactCaseID.ToString()
                , (IsMain?"1":"0")
                , AuthServer.GetLoginUser().ID.ToString()
            },
                            NSDBUtil.CmdOpType.ExecuteScalar));
        }
        catch (Exception ex)
        {
            throw ex;
        }
        return(NewID);
    }
Exemple #4
0
    private void GetEmails()
    {
        DataTable dt = (DataTable)DBUtil.DBOp("ConnDB",
                                              "SELECT [EmailID],[Email]  FROM [C_CaseUserEmail] where [LogicDel]=0 and [CaseID]={0} order by [EmailID]  ",
                                              new string[] { CaseID.ToString() },
                                              NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

        Emails = new List <UserEmail>();
        foreach (DataRow r in dt.Rows)
        {
            Emails.Add(new UserEmail(Convert.ToInt32(r["EmailID"]), r["Email"].ToString()));
        }
    }
Exemple #5
0
    public int Add()
    {
        int newid = 0;

        try
        {
            newid = Convert.ToInt32(DBUtil.DBOp("ConnDB", " exec dbo.usp_CaseUser_xAddCaseUserComment {0},{1},{2},{3},{4},{5}",
                                                new string[] { CaseID.ToString(), CreatedUserID.ToString(), RemarkType, RemarkContent, FileID.ToString(), (RemarkType == "3" ? "1":"0") }
                                                , NSDBUtil.CmdOpType.ExecuteScalar));
        }
        catch {
        }
        return(newid);
    }
Exemple #6
0
    private void GetMobiles()
    {
        DataTable dt = (DataTable)DBUtil.DBOp("ConnDB",
                                              "SELECT MobileID,[MobileNo]  FROM [C_CaseUserMobile] where [LogicDel]=0 and [CaseID]={0} order by [MobileID]  ",
                                              new string[] { CaseID.ToString() },
                                              NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

        Mobiles = new List <UserMobile>();

        foreach (DataRow r in dt.Rows)
        {
            Mobiles.Add(new UserMobile(Convert.ToInt32(r["MobileID"]), r["MobileNo"].ToString()));
        }
    }
Exemple #7
0
        public void Save()
        {
            var path = Path.Combine(Utilities.App_Data, "Cases", CaseID.Substring(0, 4), CaseID.Substring(4, 2), CaseID.Substring(6, 2), CaseID + ".json");

            File.WriteAllText(path, Json.Encode(this));
            if (Config.Current.File_Encryption)
            {
                // TODO: Encryption fails when account doesn't have write access to entire path.  Find workaround.
                try
                {
                    File.Encrypt(path);
                }
                catch { }
            }
            else
            {
                try
                {
                    File.Decrypt(path);
                }
                catch { }
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        //base.AllowHttpMethod("POST");

        int pgNow;
        int pgSize;
        int CaseID;

        int.TryParse(Request.Form["pgNow"], out pgNow);
        int.TryParse(Request.Form["pgSize"], out pgSize);
        int.TryParse(Request.Form["CaseID"], out CaseID);


        DataTableCollection dtc = (DataTableCollection)DBUtil.DBOp("ConnDB"
                                                                   , "exec dbo.usp_CaseUser_xGetUserModifyLog {0},{1},{2} "
                                                                   , new string[] { pgNow.ToString()
                                                                                    , pgSize.ToString()
                                                                                    , CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTableCollection);

        List <UserModifyLogVM> list = new List <UserModifyLogVM>();
        PageVM rtn = new PageVM();

        EntityS.FillModel(list, dtc[0]);
        EntityS.FillModel(rtn, dtc[1]);
        rtn.message = list;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(rtn));
        Response.End();
    }
Exemple #9
0
        private void saveComplain()
        {
            ECCMS _objDb = new ECCMS();

            try
            {
                tblComplainRow _objComplain = new tblComplainRow();
                if (CaseID == "")
                {
                    _objComplain.CaseNo            = GetCaseNo(Convert.ToInt32(drpProvince.SelectedValue));
                    txtCaseNo.Text                 = _objComplain.CaseNo.ToString();
                    _objComplain.Sub_Date          = Convert.ToDateTime(txtSubDate.Text.Trim());
                    _objComplain.Kuchi             = Convert.ToInt32(drpKuchi.SelectedValue);
                    _objComplain.CaseProID         = Convert.ToInt32(drpCasePro.SelectedValue);
                    _objComplain.Tri_Date          = Convert.ToDateTime(txtTriDate.Text.Trim());
                    _objComplain.ProvID            = Convert.ToInt32(drpProvince.SelectedValue);
                    _objComplain.PolCen_ID         = Convert.ToInt32(drpPC.SelectedValue);
                    _objComplain.PS                = txtPS.Text.Trim();
                    _objComplain.Comp_GenderID     = Convert.ToInt32(drpGender1.SelectedValue);
                    _objComplain.Comp_Cand_ID      = Convert.ToInt32(drpCandidate.SelectedValue);
                    _objComplain.Comp_TypeID       = Convert.ToInt32(drpComplaintType.SelectedValue);
                    _objComplain.Resp_GenderID     = Convert.ToInt32(drpGender2.SelectedValue);
                    _objComplain.Resp_TypeID       = Convert.ToInt32(drpRespondantType.SelectedValue);
                    _objComplain.AllagType_ID      = Convert.ToInt32(drpAllegationType.SelectedValue);
                    _objComplain.AllegationSummary = txtSummary.Text.Trim();
                    _objComplain.Resp_OfficeID     = Convert.ToInt32(drpResponOffice.SelectedValue);
                    _objComplain.StatusID          = Convert.ToInt32(drpStatus.SelectedValue);
                    _objComplain.Decision          = txtDecision.Text.Trim();
                    _objComplain.SanctionID        = Convert.ToInt32(drpSanctTypr.SelectedValue);
                    _objComplain.Appeal            = Convert.ToInt32(drpAppeal.SelectedValue);
                    _objComplain.Ecc_HQ_Decision   = txtECCDecision.Text.Trim();
                    _objComplain.IsDeleted         = false;
                    _objComplain.CreatedBy         = UserId;
                    _objComplain.CreatedTime       = DateTime.Now;
                    _objComplain.UpdatedBy         = UserId;
                    _objComplain.UpdatedTime       = DateTime.Now;


                    _objDb.tblComplainCollection.Insert(_objComplain);
                    _Case_ID  = _objComplain.CaseID.ToString();
                    strstatus = "Add";
                }
                else if (CaseID != "")
                {
                    _objComplain                   = _objDb.tblComplainCollection.GetRow("CaseID=" + Convert.ToInt32(CaseID) + "");
                    _objComplain.Sub_Date          = Convert.ToDateTime(txtSubDate.Text.Trim());
                    _objComplain.Kuchi             = Convert.ToInt32(drpKuchi.SelectedValue);
                    _objComplain.CaseProID         = Convert.ToInt32(drpCasePro.SelectedValue);
                    _objComplain.Tri_Date          = Convert.ToDateTime(txtTriDate.Text.Trim());
                    _objComplain.ProvID            = Convert.ToInt32(drpProvince.SelectedValue);
                    _objComplain.PolCen_ID         = Convert.ToInt32(drpPC.SelectedValue);
                    _objComplain.PS                = txtPS.Text.Trim();
                    _objComplain.Comp_GenderID     = Convert.ToInt32(drpGender1.SelectedValue);
                    _objComplain.Comp_Cand_ID      = Convert.ToInt32(drpCandidate.SelectedValue);
                    _objComplain.Comp_TypeID       = Convert.ToInt32(drpComplaintType.SelectedValue);
                    _objComplain.Resp_GenderID     = Convert.ToInt32(drpGender2.SelectedValue);
                    _objComplain.Resp_TypeID       = Convert.ToInt32(drpRespondantType.SelectedValue);
                    _objComplain.AllagType_ID      = Convert.ToInt32(drpAllegationType.SelectedValue);
                    _objComplain.AllegationSummary = txtSummary.Text.Trim();
                    _objComplain.Resp_OfficeID     = Convert.ToInt32(drpResponOffice.SelectedValue);
                    _objComplain.StatusID          = Convert.ToInt32(drpStatus.SelectedValue);
                    _objComplain.Decision          = txtDecision.Text.Trim();
                    _objComplain.SanctionID        = Convert.ToInt32(drpSanctTypr.SelectedValue);
                    _objComplain.Appeal            = Convert.ToInt32(drpAppeal.SelectedValue);
                    _objComplain.Ecc_HQ_Decision   = txtECCDecision.Text.Trim();
                    //_objComplain.IsDeleted = false;
                    _objComplain.CreatedBy   = UserId;
                    _objComplain.CreatedTime = DateTime.Now;
                    _objComplain.UpdatedBy   = UserId;
                    _objComplain.UpdatedTime = DateTime.Now;
                    _objDb.tblComplainCollection.Update(_objComplain);
                    strstatus = "Update";
                    _Case_ID  = CaseID.ToString();
                }
                //Response.Redirect("ComplainDetail.aspx?CaseNo=" + ECCCommon.EncryptQueryString(_objComplain.CaseNo.ToString()) + "");
            }
            finally
            {
                _objDb.Dispose();
            }
        }
Exemple #10
0
    protected void BindData()
    {//<table>
        //<tbody><tr>
        //<th scope="col">疫苗別</th>
        //<th scope="col">訪查日期</th>
        //<th scope="col">訪查單位(人員)</th>
        //<th scope="col">訪查方式</th>
        //<th scope="col">訪查原因</th>
        //<th scope="col">訪查紀錄</th>
        //<th scope="col">附件</th>
        //<th scope="col">刪除</th>
        //</tr>
        //</tbody>
        //</table>
        int ViewOrgID = AuthServer.GetLoginUser().OrgID;

        CaseVisitTb.Controls.Clear();

        Table           tb  = new Table();
        TableRow        thr = new TableRow();
        TableHeaderCell th1 = new TableHeaderCell();

        th1.Text = "疫苗別"; thr.Cells.Add(th1);
        TableHeaderCell th2 = new TableHeaderCell();

        th2.Text = "訪查日期"; thr.Cells.Add(th2);
        TableHeaderCell th3 = new TableHeaderCell();

        th3.Text = "訪查單位(人員)"; thr.Cells.Add(th3);
        TableHeaderCell th4 = new TableHeaderCell();

        th4.Text = "訪查方式"; thr.Cells.Add(th4);
        TableHeaderCell th5 = new TableHeaderCell();

        th5.Text = "訪查原因"; thr.Cells.Add(th5);
        TableHeaderCell th6 = new TableHeaderCell();

        th6.Text = "訪查結果"; thr.Cells.Add(th6);
        TableHeaderCell th7 = new TableHeaderCell();

        th7.Text = "附件"; thr.Cells.Add(th7);
        tb.Controls.Add(thr);


        DataTable dt = (DataTable)
                       DBUtil.DBOp("ConnDB",
                                   @"exec [dbo].[usp_CaseVist_xCaseVisitListByDoseID] {0},{1}  "
                                   , new string[] {
            CaseID.ToString()
            , DoseID
        }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);


        foreach (DataRow r in dt.Rows)
        {
            TableRow  thd = new TableRow();
            TableCell td1 = new TableCell();
            td1.Text = r["疫苗別"].ToString(); thd.Cells.Add(td1);
            TableCell td2 = new TableCell();
            td2.Text = r["訪查日期"].ToString(); thd.Cells.Add(td2);
            TableCell td3 = new TableCell();
            td3.Text = r["訪查單位(人員)"].ToString(); thd.Cells.Add(td3);
            TableCell td4 = new TableCell();
            td4.Text = SystemCode.GetName("CaseVisit_VisitType", Convert.ToInt32(r["訪查方式"])); thd.Cells.Add(td4);

            TableCell td5 = new TableCell();
            td5.Text = SystemCode.GetName("CaseVisit_VisitReason", Convert.ToInt32(r["訪查原因"])); thd.Cells.Add(td5);
            TableCell td6 = new TableCell();
            td6.Text = SystemCode.GetName("CaseVisit_VisitResult_Reason_" + r["訪查原因"], Convert.ToInt32(r["訪查結果"])); thd.Cells.Add(td6);
            TableCell td7 = new TableCell();

            int VisitOrg;
            int.TryParse(r["VisitOrg"].ToString(), out VisitOrg);
            td7.Text = ShowFiles(Convert.ToInt32(r["VisitID"]), (VisitOrg == ViewOrgID)); thd.Cells.Add(td7);

            tb.Controls.Add(thd);
        }

        CaseVisitTb.Controls.Add(tb);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string    action = Request.Form["action"] ?? "";
        JsonReply jr     = new JsonReply();

        try
        {
            if (action == "GetContactTr")
            {
                int ContactID;
                int.TryParse(Request.Form["ContactID"], out ContactID);

                StringBuilder   sb = new StringBuilder("");
                UserContact     uc = new UserContact(ContactID);
                CaseUserProfile c  = new CaseUserProfile(uc.ContactCaseID);

                sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td><a href=\"javascript:void(0);\" id=\"ModifyContact_{5}\" class=\"ModifyContact\" ><img src=\"/images/icon_maintain.png\"></a></td><td> <a  href=\"javascript:void(0);\"  id=\"DeleteContact_{5}\" class=\"DeleteContact\"><img src=\"/images/icon_del01.gif\"></a></td></tr>", uc.RelationShipName, c.ChName, c.IdNo, c.BirthDate, (uc.IsMain ? "<img src=\"/images/icon_tick.png\" >" : ""), uc.ContactID);

                jr.Content = sb.ToString();
                jr.RetCode = 1;
            }
            else if (action == "Delete")
            {
                int ContactID;
                int.TryParse(Request.Form["ContactID"], out ContactID);
                UserContact uc = new UserContact(ContactID);
                uc.Delete();
                jr.Content = "成功";
                jr.RetCode = 1;
            }
            else if (action == "LoadContactList")
            {
                int CaseID;
                int.TryParse(Request.Form["CaseID"], out CaseID);
                StringBuilder sb = new StringBuilder("");
                sb.Append("<table id=\"Contact_TB\">");
                sb.Append("<tr><th scope=\"col\">關係</th><th scope=\"col\">姓名</th><th scope=\"col\">身分證號</th><th scope=\"col\">出生日期</th><th scope=\"col\">主要聯絡人</th><th scope=\"col\"  style=\"width:1%\">維護</th><th scope=\"col\" style=\"width:1%\">移除</th></tr>");

                DataTable dt = new DataTable();
                if (CaseID != 0)
                {
                    dt = (DataTable)DBUtil.DBOp("ConnDB", " exec dbo.usp_CaseUser_xGetCaseUserContactList {0} "
                                                , new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);
                }
                else
                {
                    //if (Session["NewCaseContacts"] != null)
                    //{
                    //    string NewCaseContacts = Session["NewCaseContacts"].ToString();
                    //    dt = (DataTable)DBUtil.DBOp("ConnDB", " exec dbo.usp_CaseUser_xGetCaseUserContactList {0} "
                    // , new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteReaderReturnDataTable);

                    //}
                }
                foreach (DataRow r in dt.Rows)
                {
                    sb.AppendFormat("<tr><td>{0}</td><td>{1}</td><td>{2}</td><td>{3}</td><td>{4}</td><td><a href=\"javascript:void(0);\" id=\"ModifyContact_{5}\" class=\"ModifyContact\" ><img src=\"/images/icon_maintain.png\"></a></td><td> <a  href=\"javascript:void(0);\"  id=\"DeleteContact_{5}\" class=\"DeleteContact\"><img src=\"/images/icon_del01.gif\"></a></td></tr>", r["RS"], r["ChName"], r["IdNo"], r["BirthDate"], (r["IsMain"].ToString() == "1" ? "<img src=\"/images/icon_tick.png\" >" : ""), r["ContactID"]);
                }

                sb.Append("</table>");
                jr.Content = sb.ToString();
                jr.RetCode = 1;
            }
            else if (action == "isHaveParent")
            {
                jr.Content = "無父母";
                jr.RetCode = 0;

                int CaseID;
                int.TryParse(Request.Form["CaseID"], out CaseID);
                if (Convert.ToInt32(DBUtil.DBOp("ConnDB", " SELECT  count([ContactID])  FROM [dbo].[C_CaseUserContact] where [CaseID]={0} and ([ContactRelationShip]=2 or [ContactRelationShip]=3) and LogicDel=0 "
                                                , new string[] { CaseID.ToString() }, NSDBUtil.CmdOpType.ExecuteScalar)) > 0)
                {
                    jr.Content = "有父或母";
                    jr.RetCode = 1;
                }
            }
            else if (action == "IsHaveParentWithContactIDs")
            {
                jr.Content = "無父母";
                jr.RetCode = 0;
                string ContactIDs = Request.Form["ContactIDs"] ?? "";

                if (ContactIDs != "" && Convert.ToInt32(DBUtil.DBOp("ConnDB", " SELECT  count([ContactID])  FROM [dbo].[C_CaseUserContact]   where exists (  select data from dbo.fn_slip_str({0},',') where data = [ContactID]) and ([ContactRelationShip]=2 or [ContactRelationShip]=3) and LogicDel=0 "
                                                                    , new string[] { ContactIDs }, NSDBUtil.CmdOpType.ExecuteScalar)) > 0)
                {
                    jr.Content = "有父或母";
                    jr.RetCode = 1;
                }
            }
        }
        catch {
            jr.RetCode = 0;
        }

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(jr));
        Response.End();
    }