Ejemplo n.º 1
0
    public static string addDrugAdminInfo(string DrugType, string DrugCode, string PurUnits, string DrugName, string DrugSpecificat, string PositionNum, string Univalent, string Mnemonic, string Rmarkes, string Producer, string ProducingArea, string UpperLimit, string LowerLimit, string Rmarkes2, string Rmarkes3)
    {
        string result = "";


        //string str2 = str1.TrimStart('0');
        DrugAdminModel wr        = new DrugAdminModel();
        DataTable      dataTable = wr.findDrugAdinByDrugCode(DrugCode);

        if (dataTable.Rows.Count > 0)
        {
            return("2");
        }
        int sdr = wr.AddDrug(DrugType, DrugCode, PurUnits, DrugName, DrugSpecificat, PositionNum, Univalent, Mnemonic, Rmarkes, Producer, ProducingArea, UpperLimit, LowerLimit, Rmarkes2, Rmarkes3);

        if (sdr == 0)
        {
            result = "0";
        }
        else
        {
            result = "1";
        }

        return(result);
    }
Ejemplo n.º 2
0
    public static string DrugAdminUpdateInfo(int id, string DrugType, string DrugCode, string PurUnits, string DrugName, string DrugSpecificat, string PositionNum, string Univalent, string Mnemonic, string Rmarkes, string Producer, string ProducingArea, string UpperLimit, string LowerLimit, string Rmarkes2, string Rmarkes3)
    {
        DrugAdminModel wr = new DrugAdminModel();

        if (!DrugCode.Equals(sDrugCode))
        {
            DataTable dataTable = wr.findDrugAdinByDrugCode(DrugCode);
            if (dataTable.Rows.Count > 0)
            {
                return("2");
            }
        }


        int result = wr.UpdateDrugAdminInfo(id, DrugType, DrugCode, PurUnits, DrugName, DrugSpecificat, PositionNum, Univalent, Mnemonic, Rmarkes, Producer, ProducingArea, UpperLimit, LowerLimit, Rmarkes2, Rmarkes3);

        string str = null;

        if (result == 0)
        {
            str = "0";
        }
        else
        {
            str = "1";
        }

        return(str);
    }
Ejemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt16(Request.QueryString["id"]);
            idnum1.Value = Request.QueryString["id"].ToString();
            DrugAdminModel wr = new DrugAdminModel();
            DataTable      dt = wr.findDrugAdminInfo(id);

            sDrugCode = dt.Rows[0]["DrugCode"].ToString();

            DrugType1.Value       = dt.Rows[0]["DrugType"].ToString();
            DrugName12.Value      = dt.Rows[0]["DrugName"].ToString();
            PurUnits1.Value       = dt.Rows[0]["PurUnits"].ToString();
            DrugCode1.Value       = dt.Rows[0]["DrugCode"].ToString();
            DrugSpecificat1.Value = dt.Rows[0]["DrugSpecificat"].ToString();
            PositionNum1.Value    = dt.Rows[0]["PositionNum"].ToString();
            Mnemonic1.Value       = dt.Rows[0]["Mnemonic"].ToString();
            Univalent1.Value      = dt.Rows[0]["Univalent"].ToString();
            Univalent1.Value      = dt.Rows[0]["Univalent"].ToString();
            Rmarkes1.Value        = dt.Rows[0]["Rmarkes"].ToString();
            Producer1.Value       = dt.Rows[0]["Producer"].ToString();
            ProducingArea1.Value  = dt.Rows[0]["ProducingArea"].ToString();
            UpperLimit1.Value     = dt.Rows[0]["UpperLimit"].ToString();
            LowerLimit1.Value     = dt.Rows[0]["LowerLimit"].ToString();
            Rmarkes21.Value       = dt.Rows[0]["Rmarkes2"].ToString();
            Rmarkes31.Value       = dt.Rows[0]["Rmarkes3"].ToString();
        }
    }
Ejemplo n.º 4
0
    public static bool deleteDrugAdminById(string strRowIds)
    {
        string[] strRows1Id = strRowIds.Split(',');
        for (int i = 0; i < strRows1Id.Length; i++)
        {
            DrugAdminModel rm = new DrugAdminModel();
            rm.deleteDrugAdminInfo(Convert.ToInt16(strRows1Id[i]));
        }

        return true;

    }
Ejemplo n.º 5
0
    public static int deletedrugmatchinginfo(string strRowIds)
    {
        int end = 0;

        string[] strRows1Id = strRowIds.Split(',');
        for (int i = 0; i < strRows1Id.Length; i++)
        {
            DrugAdminModel rm = new DrugAdminModel();
            end = rm.deleteDrugmatchingInfo(Convert.ToInt16(strRows1Id[i]));
        }

        return(end);
    }
Ejemplo n.º 6
0
    public static string addmatchingInfo(string hospitalname, string DrugName12, string DrugCode1, string ypcdrugname, string ypcdrugcode)
    {
        string result = "";


        //string str2 = str1.TrimStart('0');
        DrugAdminModel wr = new DrugAdminModel();

        int sdr = wr.Adddrugmatchinginfo(hospitalname, DrugName12, DrugCode1, ypcdrugname, ypcdrugcode);

        if (sdr == 0)
        {
            result = "0";
        }
        else
        {
            result = "1";
        }

        return(result);
    }
Ejemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            HospitalModel hm  = new HospitalModel();
            SqlDataReader sdr = hm.findHospitalAll();
            int           hid = 0;
            if (sdr != null)
            {
                while (sdr.Read())
                {
                    if (hid == 0)
                    {
                        hid = Convert.ToInt32(sdr["ID"].ToString());
                    }
                    this.hospitalname123.Items.Add(new ListItem(sdr["Hname"].ToString(), sdr["ID"].ToString()));
                }
            }
        }



        if (Request.QueryString["id"] != null)
        {
            int id = Convert.ToInt16(Request.QueryString["id"]);
            idnum1.Value = Request.QueryString["id"].ToString();
            DrugAdminModel wr = new DrugAdminModel();
            DataTable      dt = wr.findDrugmatchingInfo(id);


            DrugName12.Value  = dt.Rows[0]["drugName"].ToString();
            DrugCode1.Value   = dt.Rows[0]["drugNum"].ToString();
            ypcdrugname.Value = dt.Rows[0]["drugDetailedName"].ToString();
            ypcdrugcode.Value = dt.Rows[0]["drugAlias"].ToString();
            //   positionnum.Value = dt.Rows[0]["positionNum"].ToString();
            hospitalname123.Value = dt.Rows[0]["hospitalid"].ToString();
        }
    }
Ejemplo n.º 8
0
    public static int insertDrugMatching(int hospitalId, string hospitalName, string hdrugNum, string ypcdrugNum, string hdrugName
                                         , string ypcdrugName, string hdrugOriginAddress, string ypcdrugOriginAddress, string hdrugSpecs, string ypcdrugSpecs
                                         , string hdrugTotal, string ypcdrugTotal, string pspNum, string ypcdrugPositionNum, string pspId, string drugId)
    {
        DrugAdminModel wr = new DrugAdminModel();



        int count             = 0;
        DrugMatchingModel dmm = new DrugMatchingModel();
        DataTable         dt  = dmm.findNotCheckAndMatchRecipeDrugInfo(hdrugNum);

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DrugMatchingInfo drugMatchingInfo = new DrugMatchingInfo();
                drugMatchingInfo.hospitalId           = Convert.ToInt32(dt.Rows[i]["hospitalId"].ToString());
                drugMatchingInfo.hospitalName         = dt.Rows[i]["hospitalName"].ToString();
                drugMatchingInfo.hdrugNum             = dt.Rows[i]["hdrugNum"].ToString();
                drugMatchingInfo.ypcdrugNum           = ypcdrugNum;
                drugMatchingInfo.hdrugName            = dt.Rows[i]["hdrugName"].ToString();
                drugMatchingInfo.ypcdrugName          = ypcdrugName;
                drugMatchingInfo.hdrugOriginAddress   = hdrugOriginAddress;
                drugMatchingInfo.ypcdrugOriginAddress = ypcdrugOriginAddress;
                drugMatchingInfo.hdrugSpecs           = hdrugSpecs;
                drugMatchingInfo.ypcdrugSpecs         = ypcdrugSpecs;
                drugMatchingInfo.hdrugTotal           = dt.Rows[i]["hdrugTotal"].ToString();
                drugMatchingInfo.ypcdrugTotal         = ypcdrugTotal;
                drugMatchingInfo.pspNum             = dt.Rows[i]["pspNum"].ToString();
                drugMatchingInfo.ypcdrugPositionNum = ypcdrugPositionNum;
                drugMatchingInfo.pspId  = dt.Rows[i]["pspId"].ToString();
                drugMatchingInfo.drugId = dt.Rows[i]["drugId"].ToString();
                count += dmm.insertDrugMatching(drugMatchingInfo);
                int         sdr = wr.Adddrugmatchinginfo(dt.Rows[i]["hospitalId"].ToString(), dt.Rows[i]["hdrugName"].ToString(), dt.Rows[i]["hdrugNum"].ToString(), ypcdrugName, ypcdrugNum);
                RecipeModel rm  = new RecipeModel();

                bool boo = rm.checkPrescriptionIsMath(Convert.ToInt32(drugMatchingInfo.pspId));
                if (boo)
                {
                    SqlDataReader sdr2        = rm.findisneedcheckstatus();
                    string        isneedcheck = "";
                    if (sdr2.Read())
                    {
                        isneedcheck = sdr2["isneedcheck"].ToString();
                    }

                    if (isneedcheck == "0")
                    {
                        rm.updatePrescriptionStatus(Convert.ToInt32(drugMatchingInfo.pspId), "未审核");
                    }
                    if (isneedcheck == "1")
                    {
                        string reasonText = "";
                        string name       = "";
                        string employeeid = "";

                        int num = rm.checkPrescription(Convert.ToInt32(drugMatchingInfo.pspId), 1, reasonText, name, employeeid);
                        rm.updatePrescriptionStatus(Convert.ToInt32(drugMatchingInfo.pspId), "已审核");
                    }
                }
            }
        }

        return(count);
    }