Ejemplo n.º 1
0
    protected void fetch_Click1(object sender, EventArgs e)
    {
        List <FetchRecords> fetchRecords = new List <FetchRecords>();

        for (int i = 0; i < this.notFetchOrders.Rows.Count; i++)
        {
            if (((CheckBox)notFetchOrders.Rows[i].FindControl("select")).Checked)
            {
                FetchRecords f = new FetchRecords();
                f.PatientNum  = notFetchOrders.Rows[i].Cells[1].Text.ToString();
                f.FetchTime   = System.DateTime.Now.ToString();
                f.Person      = fetchPerson.Text;
                f.medName     = notFetchOrders.Rows[i].Cells[5].Text.ToString();
                f.Amount      = Convert.ToInt32(notFetchOrders.Rows[i].Cells[4].Text);
                f.PatientName = DatabaseTool.ExeclSqlReturnItem(String.Format("select * from patient where p_number =\"{0}\" ", f.PatientNum), "p_name").ToString();
                f.MedcineNum  = notFetchOrders.Rows[i].Cells[6].Text.ToString();
                f.OrderNum    = notFetchOrders.Rows[i].Cells[7].Text.ToString();
                fetchRecords.Add(f);
            }
        }
        if (FetchRecordService.AddFetchRecords(fetchRecords) > 0)
        {
            Response.Write("<script language=javascript>window.alert('取药成功!');</script>");
            notFetchOrders.DataSource = DatabaseTool.ExecSqlReturnDataSet(String.Format("select* from orders where patient_num=\"{0}\" and isfetch=0 and type=1", patientNum.Text));
            notFetchOrders.DataBind();
        }
        else
        {
            Response.Write("<script language=javascript>window.alert('存在取药数量大于库存量失败的取药记录!');</script>");
            notFetchOrders.DataSource = DatabaseTool.ExecSqlReturnDataSet(String.Format("select* from orders where patient_num=\"{0}\" and isfetch=0 and type=1", patientNum.Text));
            notFetchOrders.DataBind();
        }
    }
Ejemplo n.º 2
0
    public static int JudgeFetchDuplicate(String fetchNum)
    {
        List <FetchRecords> fetchRecords = new List <FetchRecords>();

        fetchRecords = FetchRecordService.QueryFetchByNum(fetchNum);
        if (fetchRecords.Count == 0)
        {
            return(0);
        }
        else
        {
            return(-1);
        }
    }
Ejemplo n.º 3
0
    protected void Button2_Click1(object sender, EventArgs e)
    {
        List <FetchRecords> fetchRecords = new List <FetchRecords>();

        fetchRecords = FetchRecordService.QueryFetchByNum(patientId.Text);
        if (fetchRecords.Count == 0)
        {
            Response.Write("<script language=javascript>window.alert('无此病人信息,请重新输入编号!');</script>");
        }
        else
        {
            addFetchRecords(fetchRecords);
        }
    }