예제 #1
0
    public static string submitDrugInfo(string hospitalid, string drugpspnum, string drugnum, string drugname
                                        , string drugdescription, string drugposition, string drugallnum, string drugweight, string tienum
                                        , string description, string wholesaleprice, string retailprice, string pid)
    {
        DrugInfo      dinfo = new DrugInfo();
        HospitalModel hm    = new HospitalModel();

        dinfo.nHospitalNum = Convert.ToInt16(hospitalid);

        dinfo.strPspnum   = drugpspnum;
        dinfo.strDrugNum  = drugnum;
        dinfo.strDrugName = drugname;
        if (drugdescription == "")
        {
            dinfo.strDrugDsp = "无";
        }
        else
        {
            dinfo.strDrugDsp = drugdescription;
        }
        dinfo.strDrugPosition = drugposition;
        dinfo.nAllNum         = Convert.ToInt32(drugallnum);
        dinfo.dWeight         = Convert.ToDouble(drugweight);
        dinfo.nTieNum         = Convert.ToInt32(tienum);
        if (description == "")
        {
            dinfo.strDsp = "无";
        }
        else
        {
            dinfo.strDsp = description;
        }
        if (wholesaleprice != "")
        {
            dinfo.dWholeSalePrice = Convert.ToDouble(wholesaleprice);
        }
        else
        {
        }
        if (retailprice != "")
        {
            dinfo.dRetailPrice = Convert.ToDouble(retailprice);
        }
        else
        {
        }
        RecipeModel m     = new RecipeModel();
        DataTable   table = m.findPrescriptionById(pid);

        if (table.Rows.Count > 0)
        {
            if ("1".Equals(table.Rows[0]["confirmDrug"].ToString()))
            {
                return("该处方药品已录入完成,不可以在录入药品");
            }
            else
            {
                EnterDrug ed = new EnterDrug();
                /**/
                bool rn = ed.AddDrug(dinfo);

                if (rn)
                {
                    return("录入成功");
                }
                else
                {
                    return("录入失败");
                }
            }
        }
        else
        {
            return("处方不存在");
        }
    }
예제 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string strTip = "";

        // Request.QueryString["decmothed"].ToString();

        if (Request.QueryString["drughospitalname"].ToString() == "")
        {
            strTip += "医院名;";
        }

        if (Request.QueryString["drugpspnum"].ToString() == "")
        {
            strTip += "处方号;";
        }
        if (Request.QueryString["drugnum"].ToString() == "")
        {
            strTip += "药品编号;";
        }
        if (Request.QueryString["drugname"].ToString() == "")
        {
            strTip += "药品名称;";
        }
        if (Request.QueryString["drugposition"].ToString() == "")
        {
            strTip += "药品规格;";
        }
        if (Request.QueryString["drugallnum"].ToString() == "")
        {
            strTip += "单剂量;";
        }
        if (Request.QueryString["drugweight"].ToString() == "")
        {
            strTip += "总剂量;";
        }
        if (Request.QueryString["tienum"].ToString() == "")
        {
            strTip += "贴数;";
        }

        if (strTip != "")
        {
            strTip = "以下信息不能空,请填写: " + strTip;

            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('" + strTip + "');}window.onload=ShowAlert;</script>");
            return;
        }



        DrugInfo dinfo = new DrugInfo();
        //dinfo.strDelNum = drugdelnum.Value;
        // dinfo.nHospitalNum = Convert.ToInt16(drughospitalnum.Value);

        HospitalModel hm         = new HospitalModel();
        SqlDataReader sr         = hm.findhospitalidbyhname(Request.QueryString["drughospitalname"].ToString());
        string        hospitalid = "";

        if (sr.Read())
        {
            hospitalid = sr["id"].ToString();
        }



        dinfo.nHospitalNum = Convert.ToInt16(hospitalid);



        dinfo.strPspnum   = Request.QueryString["drugpspnum"].ToString();
        dinfo.strDrugNum  = Request.QueryString["drugnum"].ToString();
        dinfo.strDrugName = Request.QueryString["drugname"].ToString();
        if (Request.QueryString["drugdescription"].ToString() == "")
        {
            dinfo.strDrugDsp = "无";
        }
        else
        {
            dinfo.strDrugDsp = Request.QueryString["drugdescription"].ToString();
        }
        dinfo.strDrugPosition = Request.QueryString["drugposition"].ToString();
        dinfo.nAllNum         = Convert.ToInt32(Request.QueryString["drugallnum"].ToString());
        dinfo.dWeight         = Convert.ToDouble(Request.QueryString["drugweight"].ToString());
        dinfo.nTieNum         = Convert.ToInt32(Request.QueryString["tienum"].ToString());
        if (Request.QueryString["description"].ToString() == "")
        {
            dinfo.strDsp = "无";
        }
        else
        {
            dinfo.strDsp = Request.QueryString["description"].ToString();
        }
        if (Request.QueryString["wholesaleprice"].ToString() != "")
        {
            dinfo.dWholeSalePrice = Convert.ToDouble(Request.QueryString["wholesaleprice"].ToString());
        }
        else
        {
        }
        if (Request.QueryString["retailprice"].ToString() != "")
        {
            dinfo.dRetailPrice = Convert.ToDouble(Request.QueryString["retailprice"].ToString());
        }
        else
        {
        }
        //dinfo.dWholeSaleCost = Convert.ToDouble(wholesalecost.Value);
        // dinfo.dRetailCost = Convert.ToDouble(retailcost.Value);
        // dinfo.dMoneyWithTax = Convert.ToDouble(moneywithtax.Value);
        // dinfo.dFee = Convert.ToDouble(fee.Value);

        EnterDrug ed = new EnterDrug();
        bool      rn = ed.AddDrug(dinfo);

        if (rn)
        {
            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('药品录入成功');}window.onload=ShowAlert;</script>");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('录入失败,此处方已在审核之后阶段不能再添加药品!');}window.onload=ShowAlert;</script>");
        }
    }
예제 #3
0
    protected void btnOkClick(object sender, EventArgs e)
    {
        string strTip = "";

        if (delnum.Value == "")
        {
            strTip += "委托单号;";
        }
        if (pspnum.Value == "")
        {
            strTip += "电子处方号;";
        }
        if (drugnum.Value == "")
        {
            strTip += "药品编号;";
        }
        if (drugname.Value == "")
        {
            strTip += "药品名称;";
        }
        if (drugposition.Value == "")
        {
            strTip += "药品位置;";
        }
        if (drugallnum.Value == "")
        {
            strTip += "药品总数量;";
        }
        if (drugweight.Value == "")
        {
            strTip += "药品重量;";
        }
        if (tienum.Value == "")
        {
            strTip += "贴数;";
        }

        if (strTip != "")
        {
            strTip = "以下信息不能空,请填写: " + strTip;

            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('" + strTip + "');}window.onload=ShowAlert;</script>");
        }


        DrugInfo dinfo = new DrugInfo();

        dinfo.nHospitalNum    = Convert.ToInt16(hospitalid.Value);
        dinfo.strHospitalName = hospitalname.Value;
        dinfo.strPspnum       = pspnum.Value;
        dinfo.strDrugNum      = drugnum.Value;
        dinfo.strDrugName     = drugname.Value;
        dinfo.strDrugDsp      = drugdescription.Value;
        dinfo.strDrugPosition = drugposition.Value;
        dinfo.nAllNum         = Convert.ToInt16(drugallnum.Value);
        dinfo.dWeight         = Convert.ToDouble(drugweight.Value);
        dinfo.nTieNum         = Convert.ToInt16(tienum.Value);
        dinfo.strDsp          = description.Value;
        dinfo.dWholeSalePrice = Convert.ToDouble(wholesaleprice.Value);
        dinfo.dRetailPrice    = Convert.ToDouble(retailprice.Value);
        dinfo.dWholeSaleCost  = Convert.ToDouble(wholesalecost.Value);
        dinfo.dRetailCost     = Convert.ToDouble(retailcost.Value);
        dinfo.dMoneyWithTax   = Convert.ToDouble(moneywithtax.Value);
        dinfo.dFee            = Convert.ToDouble(fee.Value);

        EnterDrug ed = new EnterDrug();
        bool      rn = ed.AddDrug(dinfo);

        if (rn)
        {
            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('药品录入成功');}window.onload=ShowAlert;</script>");
        }
        else
        {
            Page.ClientScript.RegisterStartupScript(
                this.GetType(), "myscript",
                "<script type=\"text/javascript\">function ShowAlert(){alert('药品录入成功');}window.onload=ShowAlert;</script>");
        }
    }