예제 #1
0
        protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
        {
            string floor, timetype, area;

            floor = Common.GetComboBoxValue(cboFLOOR);
            if (floor == "")
            {
                floor = sFLOOR.Text;
            }

            area = Common.GetComboBoxValue(cboArea);
            if (area == "")
            {
                area = sAREA.Text;
            }

            timetype = Common.GetComboBoxValue(cboTIME);
            if (timetype == "")
            {
                timetype = sTIME.Text;
            }
            else
            {
                sTIME.Text = timetype;
            }

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=weeksch" + "&_REPORT_sQM=" + sFLOOR.Text + "&_REPORT_P=" + timetype;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
 protected void OnbtnPrintS_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=drug_term&_PAT_IC=" + Patient_ID.Text + "&_REPORT_P=short";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
예제 #3
0
 protected void btnPrint_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_REPORT_NAME=s01&_INFO_DATE=" + _Get_YMD2(DateField1.Text) + "&_REPORT_P=" + sTIME.Text;
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
 protected void Btn_Print_Click(object Sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_PAT_ID=" + _PAT_ID + "&_REPORT_NAME=A09";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
 protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
 {
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_PAT_ID=" + _PAT_ID + "&_INFO_DATE=" + sel_date.Text + "&_REPORT_NAME=f6a";
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
 protected void OnbtnPrint_Click(object sender, DirectEventArgs e)
 {
     GetWeek();
     PrintWindow.Show();
     PrintWindow.Loader.SuspendScripting();
     PrintWindow.Loader.Url            = "report/Report_Dialysis_h.aspx?_REPORT_NAME=checkin&_INFO_DATE=" + sDATE.Text + "&_REPORT_P=" + sWEEK.Text + "&_REPORT_sQM=" + sFLOOR.Text;
     PrintWindow.Loader.DisableCaching = true;
     PrintWindow.LoadContent();
 }
예제 #7
0
        protected void BtnPrint_Click(object sender, DirectEventArgs e)
        {
            string Url = "../report/Report_Dialysis_h.aspx?_PAT_IC=" + _PAT_IC + "&_BEG_DATE=" + _Get_YMD(start_date.Text) + "&_END_DATE=" + _Get_YMD(end_date.Text) + "&_REPORT_NAME=100";

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = Url;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
예제 #8
0
        protected void btnPrint_Click(object sender, DirectEventArgs e)
        {
            btnDetail_Click(sender, e);
            toDay = DateTime.Now.ToString("yyyy-MM-dd");
            string seldate = _Get_YMD2(this.DateField1.Text);
            string sSQL2   = "SELECT * FROM drug_itemlist ";

            sSQL2 += "WHERE dyivl_ivdate='" + toDay + "' ";
            DataTable dt2      = db.Query(sSQL2);
            string    SerialNo = "";

            if (dt2.Rows.Count > 0)
            {
                SerialNo = dt2.Rows[0]["dyivl_serialno"].ToString();
            }

            PrintWindow.Show();
            PrintWindow.Loader.SuspendScripting();
            PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_INFO_DATE=" + seldate + "&_REPORT_NAME=s05&_REPORT_P=" + SerialNo;
            PrintWindow.Loader.DisableCaching = true;
            PrintWindow.LoadContent();
        }
예제 #9
0
        protected void btnPrint_Click(object sender, DirectEventArgs e)
        {
            BtnSaveRight_Click(sender, e);
            string sno  = SNO.Text;
            string date = RPT_DATE.Text;

            if (sno != null && sno.Length > 0)
            {
                PrintWindow.Show();
                PrintWindow.Loader.SuspendScripting();
                PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_INFO_DATE=" + date + "&_REPORT_NAME=s03&_REPORT_P=" + sno;
                PrintWindow.Loader.DisableCaching = true;
                PrintWindow.LoadContent();

                // update the print log
                string dateString     = DateTime.Now.ToString("yyyy-MM-dd");
                string SQLT_IV_UPDATE = "UPDATE dailyiv_list SET dyiv_printdate = '{0}' WHERE dyiv_serialno = '{1}'; ";
                string sqlUpdate      = string.Format(SQLT_IV_UPDATE, dateString, sno);
                db.Excute(sqlUpdate);
                //扣庫存
                string sSQL = "SELECT * FROM dailyiv_itemlist ";
                sSQL += "WHERE dyivl_serialno='" + sno + "' AND dyivl_rec='N'";
                DataTable dt     = db.Query(sSQL);
                int       outamt = 0;
                int       invamt = 0;
                foreach (DataRow row in dt.Rows)
                {
                    string item = row["dyivl_item"].ToString();
                    int    qty  = int.Parse(row["right_qty"].ToString()); //正確的領用數量
                    string sql  = "SELECT invs_outamt, invs_invamt FROM inventory_stock ";
                    sql += "WHERE invs_name='" + item + "'";
                    DataTable dt1 = db.Query(sql);
                    if (dt1.Rows.Count > 0)
                    {
                        outamt = int.Parse(dt1.Rows[0]["invs_outamt"].ToString()) + qty;
                        invamt = int.Parse(dt1.Rows[0]["invs_invamt"].ToString()) - qty;
                        try
                        {
                            sql  = "UPDATE inventory_stock SET ";
                            sql += "invs_outamt='" + outamt + "',";
                            sql += "invs_invamt='" + invamt + "',";
                            sql += "invs_lastupdate='" + date + "' ";
                            sql += "WHERE invs_name='" + item + "'; ";

                            sql += "UPDATE dailyiv_itemlist SET ";
                            sql += "dyivl_rec='Y', ";
                            sql += "dyivl_qty=right_qty ";
                            sql += "WHERE dyivl_serialno='" + sno + "'; ";
                            db.Excute(sql);
                        }
                        catch (Exception ex)
                        {
                            _NotificationShow("储存失败!");
                        }
                    }
                }
                //扣庫存
            }
            else
            {
                _NotificationShow("请选择要列印的项目。");
            }
        }
예제 #10
0
        protected void BtnPrint_Click(object sender, DirectEventArgs e)
        {
            string json = e.ExtraParams["SelectedRow"];

            Dictionary <string, string>[]  selRow = JSON.Deserialize <Dictionary <string, string>[]>(json);
            ChangeRecords <InvReturnModel> recs   = new StoreDataHandler(e.ExtraParams["data"]).BatchObjectData <InvReturnModel>();
            string dateString = DateTime.Now.ToString("yyyy-MM-dd");

            if (selRow.Count() > 0)
            {
                dateString = selRow[0]["dyiv_ivdate"];
            }

            // 原则上这样的行为只会有 insert.
            string SQLT_INV_RETURN_UPDATE = @"
                UPDATE inv_return
                SET invr_rtnamt='{0}',
                    invr_datereturn='{1}'
                WHERE invr_id = '{2}'; ";
            string SQLT_INV_RETURN_INSERT = @"
                INSERT INTO inv_return (invr_no, invr_name, invr_preamt, invr_rtnamt, invr_serialno, invr_datereturn)
                VALUES ('{0}', '{1}', '{2}', '{3}', '{4}', '{5}'); ";

            // inserting or update?
            try {
                if (recs.Updated.Count > 0)
                {
                    int    id;
                    string sql = "";
                    if (int.TryParse(recs.Updated[0].Id, out id))
                    {
                        foreach (InvReturnModel curItem in recs.Updated)
                        {
                            sql += string.Format(SQLT_INV_RETURN_UPDATE,
                                                 curItem.RetAmt,
                                                 dateString,
                                                 curItem.Id);
                        }
                    }
                    else
                    {
                        foreach (InvReturnModel curItem in recs.Updated)
                        {
                            sql += string.Format(SQLT_INV_RETURN_INSERT,
                                                 curItem.No,
                                                 curItem.Name,
                                                 curItem.PreAmt,
                                                 curItem.RetAmt,
                                                 curItem.SerialNo,
                                                 dateString);
                        }
                        db.Excute(sql);
                    }
                }

                if (selRow.Count() > 0)
                {
                    string serialno  = selRow[0]["dyiv_serialno"].ToString();
                    string usrnm     = selRow[0]["dyiv_usrnm"].ToString();
                    string printdate = selRow[0]["dyiv_printdate"];
                    string ivdate    = selRow[0]["dyiv_ivdate"];

                    PrintWindow.Show();
                    PrintWindow.Loader.SuspendScripting();
                    PrintWindow.Loader.Url            = "../report/Report_Dialysis_h.aspx?_INFO_DATE=" + ivdate + "&_REPORT_NAME=s04&_REPORT_P=" + serialno;
                    PrintWindow.Loader.DisableCaching = true;
                    PrintWindow.LoadContent();

                    //入庫存
                    string sSQL = "SELECT * FROM inv_return ";
                    sSQL += "WHERE invr_serialno='" + serialno + "' AND invr_rtnamt<>'0' ";
                    DataTable dt     = db.Query(sSQL);
                    int       inamt  = 0;
                    int       invamt = 0;
                    foreach (DataRow row in dt.Rows)
                    {
                        string item = row["invr_name"].ToString();
                        int    qty  = int.Parse(row["invr_preamt"].ToString());
                        string sql  = "SELECT invs_inamt, invs_invamt FROM inventory_stock ";
                        sql += "WHERE invs_name='" + item + "'";
                        DataTable dt1 = db.Query(sql);
                        if (dt1.Rows.Count > 0)
                        {
                            inamt  = int.Parse(dt1.Rows[0]["invs_inamt"].ToString()) - qty;
                            invamt = int.Parse(dt1.Rows[0]["invs_invamt"].ToString()) + qty;
                            try
                            {
                                sql  = "UPDATE inventory_stock SET ";
                                sql += "invs_inamt='" + inamt + "',";
                                sql += "invs_invamt='" + invamt + "',";
                                sql += "invs_lastupdate='" + printdate + "' ";
                                sql += "WHERE invs_name='" + item + "'; ";

                                sql += "UPDATE inv_return SET invr_rec='Y' ";
                                sql += "WHERE invr_serialno='" + serialno + "';";
                                db.Excute(sql);
                            }
                            catch (Exception ex)
                            {
                                _NotificationShow("储存失败!");
                            }
                        }
                    }
                    //入庫存
                }
                else
                {
                    _NotificationShow("请选择要列印的项目。");
                }
            } catch (Exception ex) {
                Common._ErrorMsgShow(ex.Message.ToString());
            }
        }