예제 #1
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int CaseUserID = GetNumber <int>("c");
        int FluNotes   = GetNumber <int>("f");
        int Chk        = 0;

        var user = AuthServer.GetLoginUser();

        Dictionary <string, object> OutDict = new Dictionary <string, object>()
        {
            { "@Chk", Chk }
        };

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_RecordM_xAddRegisterDataByFluNotes"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@UserID", user.ID },
            { "@CaseUserID", CaseUserID },
            { "@FluNotes", FluNotes }
        });

        Chk = (int)OutDict["@Chk"];

        OPVM VM = new OPVM();

        VM.chk = Chk;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(VM));
        Response.End();
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int ID          = GetNumber <int>("i");
        int OrgLevel    = GetNumber <int>("ol");
        int AgencyState = GetNumber <int>("as");
        int OrderNumber = GetNumber <int>("on");

        string AgencyCode         = GetString("ac");
        string OrgAgencyName      = GetString("n");
        string OrgAgencyEnName    = GetString("en");
        string OrgAgencyShortName = GetString("sn");
        string IPs = GetString("ips");

        IPs = HttpUtility.UrlDecode(IPs);
        var list    = JsonConvert.DeserializeObject <List <OrgAllowIPVM> >(IPs);
        var IpSList = list.Select(item => PureString(item.IpStart)).ToList();
        var IpEList = list.Select(item => PureString(item.IpEnd)).ToList();

        if (ID > 0)
        {
            int Chk = 0;

            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@Chk", Chk }
            };

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_OrgM_xUpdateOrgDetailByID"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@OrgID", ID },
                { "@AgencyCode", AgencyCode },
                { "@OrgAgencyName", OrgAgencyName },
                { "@OrgAgencyEnName", OrgAgencyEnName },
                { "@OrgAgencyShortName", OrgAgencyShortName },
                { "@OrgLevel", OrgLevel },
                { "@AgencyState", AgencyState },
                { "@OrderNumber", OrderNumber },
                { "@IpStart", string.Join(",", IpSList) },
                { "@IpEnd", string.Join(",", IpEList) }
            });

            Chk = (int)OutDict["@Chk"];

            OPVM VM = new OPVM();
            VM.chk = Chk;

            if (Chk > 0)
            {
                SystemOrg.Update();
            }
            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);
        base.BodyClass = "class='bodybg'";

        var user = AuthServer.GetLoginUser();


        int    CaseUserID = 0;
        string SystemRecordVaccineCode      = "";
        int    RecordDataID                 = 0;
        bool   HasInsertSystemRecordVaccine = false;
        int    Chk = 0;

        int.TryParse(Request.Form["c"], out CaseUserID);
        SystemRecordVaccineCode = Request.Form["r"] ?? "";

        if (CaseUserID > 0 || SystemRecordVaccineCode.Equals("") == false)
        {
            using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
            {
                using (SqlCommand cmd = new SqlCommand("dbo.usp_RecordM_xAddRecordData", sc))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@CaseUserID", CaseUserID);
                    cmd.Parameters.AddWithValue("@SystemRecordVaccineCode", SystemRecordVaccineCode);
                    cmd.Parameters.AddWithValue("@OrgID", user.OrgID);
                    cmd.Parameters.AddWithValue("@CreatedUserID", user.ID);
                    SqlParameter sp1 = cmd.Parameters.AddWithValue("@RecordDataID", RecordDataID);
                    sp1.Direction = ParameterDirection.Output;
                    SqlParameter sp2 = cmd.Parameters.AddWithValue("@HasInsertSystemRecordVaccine", HasInsertSystemRecordVaccine);
                    sp2.Direction = ParameterDirection.Output;
                    SqlParameter sp3 = cmd.Parameters.AddWithValue("@Chk", Chk);
                    sp3.Direction = ParameterDirection.Output;

                    sc.Open();
                    cmd.ExecuteNonQuery();

                    RecordDataID = (int)sp1.Value;
                    HasInsertSystemRecordVaccine = (bool)sp2.Value;
                    Chk = (int)sp3.Value;
                }

                if (HasInsertSystemRecordVaccine == true)
                {
                    SystemRecordVaccine.Update();
                }
                OPVM VM = new OPVM();
                VM.message = RecordDataID.ToString();
                VM.chk     = Chk;

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



        int ID          = GetNumber <int>("i");
        int OrgLevel    = GetNumber <int>("ol");
        int AgencyState = GetNumber <int>("as");
        int OrderNumber = GetNumber <int>("on");


        string AgencyCode         = GetString("ac");
        string OrgAgencyName      = GetString("n");
        string OrgAgencyEnName    = GetString("en");
        string OrgAgencyShortName = GetString("sn");
        string IpStart            = GetString("is");
        string IpEnd = GetString("ie");

        if (ID > 0)
        {
            int Chk = 0;

            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@Chk", Chk }
            };

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_OrgM_xUpdateOrgDetailByID"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@OrgID", ID },
                { "@AgencyCode", AgencyCode },
                { "@OrgAgencyName", OrgAgencyName },
                { "@OrgAgencyEnName", OrgAgencyEnName },
                { "@OrgAgencyShortName", OrgAgencyShortName },
                { "@OrgLevel", OrgLevel },
                { "@AgencyState", AgencyState },
                { "@OrderNumber", OrderNumber },
                { "@IpStart", IpStart },
                { "@IpEnd", IpEnd }
            });

            Chk = (int)OutDict["@Chk"];

            OPVM VM = new OPVM();
            VM.chk = Chk;

            if (Chk > 0)
            {
                SystemOrg.Update();
            }
            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
예제 #5
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(false);

        var user = AuthServer.GetLoginUser();


        int    CaseUserID = 0;
        string SystemRecordVaccineCode      = "";
        int    SystemRecordVaccineID        = 0;
        int    RecordDataID                 = 0;
        bool   HasInsertSystemRecordVaccine = false;
        int    Chk = 0;

        CaseUserID = GetNumber <int>("c");
        SystemRecordVaccineCode = GetString("r");

        if (CaseUserID > 0 || SystemRecordVaccineCode.Length > 0)
        {
            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@RecordDataID", RecordDataID },
                { "@HasInsertSystemRecordVaccine", HasInsertSystemRecordVaccine },
                { "@SystemRecordVaccineID", SystemRecordVaccineID },
                { "@Chk", Chk }
            };

            MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_RecordM_xAddRecordData"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@CaseUserID", CaseUserID },
                { "@SystemRecordVaccineCode", SystemRecordVaccineCode },
                { "@OrgID", user.OrgID },
                { "@CreatedUserID", user.ID }
            });

            RecordDataID = (int)OutDict["@RecordDataID"];
            HasInsertSystemRecordVaccine = (bool)OutDict["@HasInsertSystemRecordVaccine"];
            Chk = (int)OutDict["@Chk"];

            if (HasInsertSystemRecordVaccine == true)
            {
                SystemRecordVaccine.Update();
            }
            OPVM VM = new OPVM();
            VM.message = RecordDataID.ToString();
            VM.chk     = Chk;

            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        string jsonString = GetString("v");
        List <RolePowerSettingPowerVM> list = new List <RolePowerSettingPowerVM>();

        list = JsonConvert.DeserializeObject <List <RolePowerSettingPowerVM> >(jsonString);

        OPVM VM = new OPVM();

        VM.chk = 1;

        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
        Response.End();
    }
예제 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);
        base.BodyClass = "class='bodybg'";

        int.TryParse(Request.Form["b"], out VaccineBatchID);
        int.TryParse(Request.Form["d"], out VaccineDataID);

        if (VaccineBatchID == 0 || VaccineDataID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_ParameterM_xAddOrUpdateDefaultVaccine", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@VaccineBatchID", VaccineBatchID);
                cmd.Parameters.AddWithValue("@VaccineDataID", VaccineDataID);
                cmd.Parameters.AddWithValue("@OrgID", user.OrgID);
                cmd.Parameters.AddWithValue("@CreatedUserID", user.ID);
                SqlParameter sp = cmd.Parameters.AddWithValue("@Chk", Chk);
                sp.Direction = ParameterDirection.Output;

                sc.Open();
                cmd.ExecuteNonQuery();

                Chk = (int)sp.Value;
            }
        }

        OPVM VM = new OPVM();

        VM.chk = Chk;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
        Response.End();
    }
예제 #8
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");
        base.DisableTop(true);

        int VaccineBatchID = GetNumber <int>("b");
        int VaccineDataID  = GetNumber <int>("d");

        if (VaccineBatchID == 0 || VaccineDataID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

        Dictionary <string, object> OutDict = new Dictionary <string, object>()
        {
            { "@Chk", Chk }
        };

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_ParameterM_xAddOrUpdateDefaultVaccine"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@VaccineBatchID", VaccineBatchID },
            { "@VaccineDataID", VaccineDataID },
            { "@OrgID", user.OrgID },
            { "@CreatedUserID", user.ID }
        });

        Chk = (int)OutDict["@Chk"];

        OPVM VM = new OPVM();

        VM.chk = Chk;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(VM));
        Response.End();
    }
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int ApplyHealthID = GetNumber <int>("i");

        if (ApplyHealthID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

        Dictionary <string, object> OutDict = new Dictionary <string, object>()
        {
            { "@Chk", Chk }
        };

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_RecordM_xDeleteApplyHealthByID"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@ApplyHealthID", ApplyHealthID }
        });

        Chk = (int)OutDict["@Chk"];

        OPVM VM = new OPVM();

        VM.chk = Chk;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(VM));
        Response.End();
    }
예제 #10
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        int ID = GetNumber <int>("i");

        if (ID > 0)
        {
            int Chk   = 0;
            int OrgID = 0;

            Dictionary <string, object> OutDict = new Dictionary <string, object>()
            {
                { "@Chk", Chk }
            };

            MSDB.ExecuteNonQuery("ConnUser", "dbo.usp_OrgM_xRemoveOrgDetailByID"
                                 , ref OutDict
                                 , new Dictionary <string, object>()
            {
                { "@OrgID", ID }
            });

            Chk = (int)OutDict["@Chk"];

            OPVM VM = new OPVM();
            VM.chk = Chk;

            if (Chk > 0)
            {
                SystemOrg.Update();
            }
            Response.ContentType = "application/json; charset=utf-8";
            Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
            Response.End();
        }
    }
예제 #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("GET", "POST");
        base.DisableTop(false);
        base.BodyClass = "class='bodybg'";

        int.TryParse(Request.Form["au"], out AssessmentUserID);
        //DateTime.TryParse(Request.Form["AD"], out AssessmentDate);
        DateTime.TryParseExact((Request.Form["ad"] ?? DateTime.Now.ToShortTaiwanDate()).RepublicToAD(),
                               "yyyyMMdd",
                               CultureInfo.InvariantCulture,
                               DateTimeStyles.None,
                               out AssessmentDate);
        bool.TryParse(Request.Form["AW"], out AllowWork);
        ApplyHealthCateIDs = Request.Form["AH"] ?? "";
        bool IsValid = false;

        try
        {
            List <int> list = ApplyHealthCateIDs.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                              .ToList <string>()
                              .ConvertAll <int>(item => int.Parse(item));

            IsValid = true;
        }
        catch
        {
        }


        OtherState = Request.Form["OS"] ?? "";
        int.TryParse(Request.Form["RD"], out RecordDataID);

        if (IsValid == false || AssessmentUserID == 0 || AssessmentDate == default(DateTime) || RecordDataID == 0)
        {
            string script = "<script>alert('資料取得失敗');history.go(-1);</script>";
            Page.ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "alert", script, false);
            return;
        }

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

        using (SqlConnection sc = new SqlConnection(WebConfigurationManager.ConnectionStrings["ConnDB"].ToString()))
        {
            using (SqlCommand cmd = new SqlCommand("dbo.usp_RecordM_xAddOrUpdateApplyHealth", sc))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@ApplyHealthID", 0);
                cmd.Parameters.AddWithValue("@AssessmentUserID", AssessmentUserID);
                cmd.Parameters.AddWithValue("@AssessmentDate", AssessmentDate);
                cmd.Parameters.AddWithValue("@CreatedUserID", user.ID);
                cmd.Parameters.AddWithValue("@AllowWork", AllowWork);
                cmd.Parameters.AddWithValue("@ApplyHealthCateIDs", ApplyHealthCateIDs);
                cmd.Parameters.AddWithValue("@OtherState", OtherState);
                cmd.Parameters.AddWithValue("@RecordDataID", RecordDataID);
                cmd.Parameters.AddWithValue("@OrgID", user.OrgID);
                SqlParameter sp = cmd.Parameters.AddWithValue("@Chk", Chk);
                sp.Direction = ParameterDirection.Output;

                sc.Open();
                cmd.ExecuteNonQuery();

                Chk = (int)sp.Value;
            }
        }

        OPVM VM = new OPVM();

        VM.chk = Chk;
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(VM));
        Response.End();
    }
예제 #12
0
    protected new void Page_Load(object sender, EventArgs e)
    {
        base.AllowHttpMethod("POST");

        DateTime AssessmentDate = DateTime.Now;

        int    SelfOrFamily          = GetNumber <int>("sf");
        int    CaseUserID            = GetNumber <int>("cc");
        int    AssessmentUserID      = GetNumber <int>("au");
        int    SystemRecordVaccineID = GetNumber <int>("ri");
        string AssessmentUserName    = GetString("aun");
        int    UpdateUID             = GetNumber <int>("uu");

        //DateTime.TryParse(Request.Form["AD"], out AssessmentDate);
        //.TryParseExact((GetString("ad")  ?? DateTime.Now.ToShortTaiwanDate()).RepublicToAD(),
        DateTime.TryParseExact((GetString("ad") ?? new DateTime(2099, 1, 1, 1, 1, 1, 0).ToShortTaiwanDate()).RepublicToAD(),
                               "yyyyMMdd",
                               CultureInfo.InvariantCulture,
                               DateTimeStyles.None,
                               out AssessmentDate);

        bool   AllowWork          = GetNumber <int>("aw") == 1 ? true :false;
        string ApplyHealthCateIDs = GetString("ah");
        bool   IsValid            = false;

        try
        {
            List <int> list = ApplyHealthCateIDs.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries)
                              .ToList <string>()
                              .ConvertAll <int>(item => int.Parse(item));

            IsValid = true;
        }
        catch
        {
        }


        string OtherState   = GetString("os");
        int    RecordDataID = GetNumber <int>("rd");

        if (UpdateUID == 0)
        {
            if (IsValid == false || AssessmentUserID == 0 || AssessmentDate == default(DateTime) || RecordDataID == 0)
            {
                OPVM VMerr = new OPVM();
                VMerr.chk            = 0;
                Response.ContentType = "application/json; charset=utf-8";
                Response.Write(JsonConvert.SerializeObject(VMerr));
                Response.End();
            }
        }

        var user = AuthServer.GetLoginUser();
        int Chk  = 0;

        Dictionary <string, object> OutDict = new Dictionary <string, object>()
        {
            { "@Chk", Chk }
        };

        MSDB.ExecuteNonQuery("ConnDB", "dbo.usp_RecordM_xAddOrUpdateApplyHealth"
                             , ref OutDict
                             , new Dictionary <string, object>()
        {
            { "@ApplyHealthID", UpdateUID },
            { "@AssessmentUserID", AssessmentUserID },
            { "@AssessmentDate", AssessmentDate },
            { "@CreatedUserID", user.ID },
            { "@AllowWork", AllowWork },
            { "@ApplyHealthCateIDs", ApplyHealthCateIDs },
            { "@OtherState", OtherState },
            { "@RecordDataID", RecordDataID },
            { "@OrgID", user.OrgID },
            { "@CaseUserID", CaseUserID },
            { "@SelfOrFamily", SelfOrFamily },
            { "@SystemRecordVaccineID", SystemRecordVaccineID }
        });

        Chk = (int)OutDict["@Chk"];

        OPVM VM = new OPVM();

        VM.chk = Chk;
        if (UpdateUID > 0)
        {
            Dictionary <string, object> dict = new Dictionary <string, object>();
            dict["I"]  = UpdateUID;
            dict["AD"] = AssessmentDate;
            dict["N"]  = AssessmentUserName;
            dict["ON"] = user.OrgName;
            dict["AS"] = "," + ApplyHealthCateIDs.Trim(',') + ",";
            dict["OS"] = OtherState;
            dict["AW"] = AllowWork;
            VM.obj     = dict;
        }
        Response.ContentType = "application/json; charset=utf-8";
        Response.Write(JsonConvert.SerializeObject(VM));
        Response.End();
    }