Beispiel #1
0
 private void setChangeLanguage()
 {
     foreach (Row row in grfOrder.Rows)
     {
         String pxid = "", itmid = "", status = "", re = "", edit = "", usage = "";
         pxid = row[colOrdid] != null ? row[colOrdid].ToString() : "";
         if (pxid.Equals(""))
         {
             continue;
         }
         itmid  = row[colOrditmid] != null ? row[colOrditmid].ToString() : "";
         status = row[colOrdstatus] != null ? row[colOrdstatus].ToString() : "";
         if (status.Equals("px"))
         {
             OldStockDrug ostkd = new OldStockDrug();
             ostkd = ic.ivfDB.oStkdDB.selectByPk1(itmid);
             if (ostkd.DUID.Length <= 0)
             {
                 continue;
             }
             if (cboLangSticker.Text.Trim().Equals("English"))
             {
                 row[colOrdUsE] = ostkd.EUsage;
                 re             = ic.ivfDB.oJpxdDB.updateUsageEByID(pxid, ostkd.EUsage);
             }
             else
             {
                 row[colOrdUsT] = ostkd.TUsage;
                 re             = ic.ivfDB.oJpxdDB.updateUsageTByID(pxid, ostkd.TUsage);
             }
         }
     }
 }
Beispiel #2
0
        public OldStockDrug setStockDrug(DataTable dt)
        {
            OldStockDrug ostkd1 = new OldStockDrug();

            if (dt.Rows.Count > 0)
            {
                ostkd1.DUID       = dt.Rows[0][ostkD.DUID].ToString();
                ostkd1.DUName     = dt.Rows[0][ostkD.DUName].ToString();
                ostkd1.EUsage     = dt.Rows[0][ostkD.EUsage].ToString();
                ostkd1.TUsage     = dt.Rows[0][ostkD.TUsage].ToString();
                ostkd1.UnitType   = dt.Rows[0][ostkD.UnitType].ToString();
                ostkd1.Alert      = dt.Rows[0][ostkD.Alert].ToString();
                ostkd1.QTY        = dt.Rows[0][ostkD.QTY].ToString();
                ostkd1.PendingQTY = dt.Rows[0][ostkD.PendingQTY].ToString();
                ostkd1.Price      = dt.Rows[0][ostkD.Price].ToString();
                ostkd1.item_code  = dt.Rows[0][ostkD.item_code].ToString();
                ostkd1.trade_name = dt.Rows[0][ostkD.trade_name].ToString();
                ostkd1.comm_name  = dt.Rows[0][ostkD.comm_name].ToString();
                ostkd1.cust_id    = dt.Rows[0][ostkD.cust_id].ToString();
            }
            else
            {
                setStockDrug1(ostkd1);
            }
            return(ostkd1);
        }
Beispiel #3
0
        private void initConfig()
        {
            fEdit  = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Regular);
            fEditB = new Font(ic.iniC.grdViewFontName, ic.grdViewFontSize, FontStyle.Bold);

            C1ThemeController.ApplicationTheme = ic.iniC.themeApplication;
            theme1.Theme = C1ThemeController.ApplicationTheme;
            theme1.SetTheme(sB, "BeigeOne");
            foreach (Control c in panel2.Controls)
            {
                theme1.SetTheme(c, "Office2013Red");
            }

            sB1.Text = "";
            stt      = new C1SuperTooltip();
            sep      = new C1SuperErrorProvider();

            sdrk = new OldStockDrug();
            ic.ivfDB.oStkdDB.setCboUsageE(cboUsageE);
            ic.ivfDB.oStkdDB.setCboUsageT(cboUsageT);
            btnNew.Click          += BtnNew_Click;
            btnSave.Click         += BtnSave_Click;
            chkVoid.Click         += ChkVoid_Click;
            txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp;
            btnVoid.Click         += BtnVoid_Click;

            initGrfStockDrug();
            setGrfStockDrug();
        }
        private void setControlDrug(String drugid)
        {
            OldStockDrug ostkD = new OldStockDrug();

            ostkD           = ic.ivfDB.oStkdDB.selectByPk1(drugid);
            txtThai.Value   = ostkD.TUsage;
            txtEng.Value    = ostkD.EUsage;
            txtQty.Value    = "0";
            txtRemark.Value = ostkD.remark;
        }
Beispiel #5
0
        public String insert(OldStockDrug p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 0;

            chkNull(p);
            //lbReq.form_a_id = "form_a_id";
            //p.req_code = genReqDoc();
            sql = "Insert Into " + ostkD.table + " Set " +
                  " " + ostkD.DUName + " = '" + p.DUName.Replace("'", "''") + "'" +
                  "," + ostkD.EUsage + "= '" + p.EUsage.Replace("'", "''") + "'" +
                  "," + ostkD.TUsage + "= '" + p.TUsage.Replace("'", "''") + "'" +
                  "," + ostkD.UnitType + "= '" + p.UnitType.Replace("'", "''") + "'" +
                  "," + ostkD.Alert + "= '" + p.Alert.Replace("'", "''") + "'" +
                  "," + ostkD.QTY + "= '" + p.QTY + "'" +
                  "," + ostkD.PendingQTY + "= '" + p.PendingQTY + "'" +
                  "," + ostkD.Price + "= '" + p.Price + "'" +
                  "," + ostkD.drug_caution + "= '" + p.drug_caution + "'" +
                  "," + ostkD.drug_description + "= '" + p.drug_description + "'" +
                  "," + ostkD.instruction_id + "= '" + p.instruction_id + "'" +
                  "," + ostkD.frequency_id + "= '" + p.frequency_id + "'" +
                  "," + ostkD.drug_caution_e + "= '" + p.drug_caution_e + "'" +
                  "," + ostkD.drug_frequency_e + "= '" + p.drug_frequency_e + "'" +
                  "," + ostkD.item_sub_group_id + "= '" + p.item_sub_group_id + "'" +
                  "," + ostkD.on_hand + "= '" + p.on_hand + "'" +
                  "," + ostkD.order_point + "= '" + p.order_point + "'" +
                  "," + ostkD.order_amount + "= '" + p.order_amount + "'" +
                  "," + ostkD.on_hand_sub_1 + "= '" + p.on_hand_sub_1 + "'" +
                  "," + ostkD.order_point_sub_1 + "= '" + p.order_point_sub_1 + "'" +
                  "," + ostkD.order_amount_sub_1 + "= '" + p.order_amount_sub_1 + "'" +
                  "," + ostkD.on_hand_sub_2 + "= '" + p.on_hand_sub_2 + "'" +
                  "," + ostkD.order_point_sub_2 + "= '" + p.order_point_sub_2 + "'" +
                  "," + ostkD.order_amount_sub_2 + "= '" + p.order_amount_sub_2 + "'" +
                  "," + ostkD.on_hand_sub_3 + "= '" + p.on_hand_sub_3 + "'" +
                  "," + ostkD.order_point_sub_3 + "= '" + p.order_point_sub_3 + "'" +
                  "," + ostkD.order_amount_sub_3 + "= '" + p.order_amount_sub_3 + "'" +
                  "," + ostkD.trade_name + "= '" + p.trade_name + "'" +
                  "," + ostkD.comm_name + "= '" + p.comm_name + "'" +
                  "," + ostkD.cust_id + "= '" + p.cust_id + "'" +
                  "";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Beispiel #6
0
        private void chkNull(OldStockDrug p)
        {
            long    chk  = 0;
            Decimal chk1 = 0;

            p.date_modi   = p.date_modi == null ? "" : p.date_modi;
            p.date_cancel = p.date_cancel == null ? "" : p.date_cancel;
            p.user_create = p.user_create == null ? "" : p.user_create;
            p.user_modi   = p.user_modi == null ? "" : p.user_modi;
            p.user_cancel = p.user_cancel == null ? "" : p.user_cancel;
            //p.prefix_id = int.TryParse(p.prefix_id, out chk) ? chk.ToString() : "0";
            //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0";
            //p.posi_id = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0";

            p.DUName           = p.DUName == null ? "" : p.DUName;
            p.EUsage           = p.EUsage == null ? "" : p.EUsage;
            p.TUsage           = p.TUsage == null ? "" : p.TUsage;
            p.UnitType         = p.UnitType == null ? "" : p.UnitType;
            p.drug_caution     = p.drug_caution == null ? "" : p.drug_caution;
            p.drug_description = p.drug_description == null ? "" : p.drug_description;
            p.drug_caution_e   = p.drug_caution_e == null ? "" : p.drug_caution_e;
            p.drug_frequency_e = p.drug_frequency_e == null ? "" : p.drug_frequency_e;
            p.trade_name       = p.trade_name == null ? "" : p.trade_name;
            p.comm_name        = p.comm_name == null ? "" : p.comm_name;

            //p.Alert = p.Alert == null ? "0" : p.Alert;
            //p.QTY = p.QTY == null ? "0" : p.QTY;
            //p.PendingQTY = p.PendingQTY == null ? "0" : p.PendingQTY;
            //p.Price = p.Price.Equals("") ? "0" : p.Price;

            p.Alert             = long.TryParse(p.Alert, out chk) ? chk.ToString() : "0";
            p.QTY               = long.TryParse(p.QTY, out chk) ? chk.ToString() : "0";
            p.PendingQTY        = long.TryParse(p.PendingQTY, out chk) ? chk.ToString() : "0";
            p.instruction_id    = long.TryParse(p.instruction_id, out chk) ? chk.ToString() : "0";
            p.frequency_id      = long.TryParse(p.frequency_id, out chk) ? chk.ToString() : "0";
            p.item_sub_group_id = long.TryParse(p.item_sub_group_id, out chk) ? chk.ToString() : "0";
            p.cust_id           = long.TryParse(p.cust_id, out chk) ? chk.ToString() : "0";

            p.Price              = Decimal.TryParse(p.Price, out chk1) ? chk1.ToString() : "0";
            p.on_hand            = Decimal.TryParse(p.on_hand, out chk1) ? chk1.ToString() : "0";
            p.order_point        = Decimal.TryParse(p.order_point, out chk1) ? chk1.ToString() : "0";
            p.order_amount       = Decimal.TryParse(p.order_amount, out chk1) ? chk1.ToString() : "0";
            p.on_hand_sub_1      = Decimal.TryParse(p.on_hand_sub_1, out chk1) ? chk1.ToString() : "0";
            p.order_point_sub_1  = Decimal.TryParse(p.order_point_sub_1, out chk1) ? chk1.ToString() : "0";
            p.order_amount_sub_1 = Decimal.TryParse(p.order_amount_sub_1, out chk1) ? chk1.ToString() : "0";
            p.on_hand_sub_2      = Decimal.TryParse(p.on_hand_sub_2, out chk1) ? chk1.ToString() : "0";
            p.order_point_sub_2  = Decimal.TryParse(p.order_point_sub_2, out chk1) ? chk1.ToString() : "0";
            p.order_amount_sub_2 = Decimal.TryParse(p.order_amount_sub_2, out chk1) ? chk1.ToString() : "0";
            p.on_hand_sub_3      = Decimal.TryParse(p.on_hand_sub_3, out chk1) ? chk1.ToString() : "0";
            p.order_point_sub_3  = Decimal.TryParse(p.order_point_sub_3, out chk1) ? chk1.ToString() : "0";
            p.order_amount_sub_3 = Decimal.TryParse(p.order_amount_sub_3, out chk1) ? chk1.ToString() : "0";

            //p.user_cancel = p.user_cancel == null ? "" : p.user_cancel;
        }
Beispiel #7
0
        public OldStockDrug selectByPk1(String copId)
        {
            OldStockDrug stf1 = new OldStockDrug();
            DataTable    dt   = new DataTable();
            String       sql  = "select ostkD.*  " +
                                "From " + ostkD.table + " ostkD " +
                                "Where ostkD." + ostkD.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            stf1 = setStockDrug(dt);
            return(stf1);
        }
Beispiel #8
0
        public String insertStockDrug(OldStockDrug p, String userId)
        {
            String re = "";

            if (p.DUID.Equals(""))
            {
                re = insert(p, "");
            }
            else
            {
                //re = update(p, "");
            }

            return(re);
        }
Beispiel #9
0
        private void initConfig()
        {
            ostkD                    = new OldStockDrug();
            ostkD.DUID               = "DUID";
            ostkD.DUName             = "DUName";
            ostkD.EUsage             = "EUsage";
            ostkD.TUsage             = "TUsage";
            ostkD.UnitType           = "UnitType";
            ostkD.Alert              = "Alert";
            ostkD.QTY                = "QTY";
            ostkD.PendingQTY         = "PendingQTY";
            ostkD.Price              = "Price";
            ostkD.active             = "active";
            ostkD.drug_caution       = "drug_caution";
            ostkD.drug_description   = "drug_description";
            ostkD.instruction_id     = "instruction_id";
            ostkD.frequency_id       = "frequency_id";
            ostkD.drug_caution_e     = "drug_caution_e";
            ostkD.drug_frequency_e   = "drug_frequency_e";
            ostkD.item_sub_group_id  = "item_sub_group_id";
            ostkD.on_hand            = "on_hand";
            ostkD.order_point        = "order_point";
            ostkD.order_amount       = "order_amount";
            ostkD.on_hand_sub_1      = "on_hand_sub_1";
            ostkD.order_point_sub_1  = "order_point_sub_1";
            ostkD.order_amount_sub_1 = "order_amount_sub_1";
            ostkD.on_hand_sub_2      = "on_hand_sub_2";
            ostkD.order_point_sub_2  = "order_point_sub_2";
            ostkD.order_amount_sub_2 = "order_amount_sub_2";
            ostkD.on_hand_sub_3      = "on_hand_sub_3";
            ostkD.order_point_sub_3  = "order_point_sub_3";
            ostkD.order_amount_sub_3 = "order_amount_sub_3";
            ostkD.item_code          = "item_code";
            ostkD.date_cancel        = "date_cancel";
            ostkD.date_create        = "date_create";
            ostkD.date_modi          = "date_modi";
            ostkD.user_cancel        = "user_cancel";
            ostkD.user_create        = "user_create";
            ostkD.user_modi          = "user_modi";
            ostkD.remark             = "remark";
            ostkD.trade_name         = "trade_name";
            ostkD.comm_name          = "comm_name";
            ostkD.cust_id            = "cust_id";

            ostkD.table   = "StockDrug";
            ostkD.pkField = "DUID";
            lstkD         = new List <OldStockDrug>();
        }
Beispiel #10
0
 private OldStockDrug setStockDrug1(OldStockDrug stf1)
 {
     stf1.DUID       = "";
     stf1.DUName     = "";
     stf1.EUsage     = "";
     stf1.TUsage     = "";
     stf1.UnitType   = "";
     stf1.Alert      = "";
     stf1.QTY        = "";
     stf1.PendingQTY = "";
     stf1.Price      = "";
     stf1.item_code  = "";
     stf1.trade_name = "";
     stf1.comm_name  = "";
     stf1.cust_id    = "";
     return(stf1);
 }
Beispiel #11
0
 private void setControl(String posiId)
 {
     sdrk             = ic.ivfDB.oStkdDB.selectByPk1(posiId);
     txtID.Value      = sdrk.DUID;
     txtDrgName.Value = sdrk.DUName;
     txtRemark.Value  = sdrk.remark;
     ic.setC1ComboByName(cboUsageE, sdrk.EUsage);
     ic.setC1ComboByName(cboUsageT, sdrk.TUsage);
     //cboUsageE.Text = sdrk.EUsage;
     //cboUsageT.Text = sdrk.TUsage;
     txtPurchase.Value = sdrk.Alert;
     txtPrice1.Value   = sdrk.Price;
     txtDrgCode.Value  = sdrk.DUID;
     txtDrgTrade.Value = sdrk.trade_name;
     txtDrgComm.Value  = sdrk.comm_name;
     btnVoid.Hide();
     txtPasswordVoid.Hide();
     chkVoid.Checked = false;
 }
Beispiel #12
0
        public String update(OldStockDrug p, String userId)
        {
            String re  = "";
            String sql = "";

            chkNull(p);

            sql = "Update " + ostkD.table + " Set " +
                  " " + ostkD.DUName + " = '" + p.DUName.Replace("'", "''") + "'" +
                  "," + ostkD.EUsage + "= '" + p.EUsage.Replace("'", "''") + "'" +
                  "," + ostkD.TUsage + "= '" + p.TUsage.Replace("'", "''") + "'" +
                  "," + ostkD.UnitType + "= '" + p.UnitType.Replace("'", "''") + "'" +
                  "," + ostkD.Alert + "= '" + p.Alert.Replace("'", "''") + "'" +
                  "," + ostkD.QTY + "= '" + p.QTY + "'" +
                  "," + ostkD.PendingQTY + "= '" + p.PendingQTY + "'" +
                  //"," + ostkD.Price + "= '" + p.Price + "'" +
                  "," + ostkD.drug_caution + "= '" + p.drug_caution + "'" +
                  "," + ostkD.drug_description + "= '" + p.drug_description + "'" +
                  "," + ostkD.instruction_id + "= '" + p.instruction_id + "'" +
                  "," + ostkD.frequency_id + "= '" + p.frequency_id + "'" +
                  "," + ostkD.drug_caution_e + "= '" + p.drug_caution_e + "'" +
                  "," + ostkD.drug_frequency_e + "= '" + p.drug_frequency_e + "'" +
                  "," + ostkD.item_sub_group_id + "= '" + p.item_sub_group_id + "'" +
                  "," + ostkD.trade_name + "= '" + p.trade_name + "'" +
                  "," + ostkD.comm_name + "= '" + p.comm_name + "'" +
                  "," + ostkD.cust_id + "= '" + p.cust_id + "'" +
                  "Where " + ostkD.pkField + "='" + p.DUID + "'";

            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Beispiel #13
0
        public List <OldStockDrug> getlStf()
        {
            //lDept = new List<Position>();

            lstkD.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                OldStockDrug itm1 = new OldStockDrug();
                itm1.DUID           = row[ostkD.DUID].ToString();
                itm1.DUName         = row[ostkD.DUName].ToString();
                itm1.EUsage         = row[ostkD.EUsage].ToString();
                itm1.TUsage         = row[ostkD.TUsage].ToString();
                itm1.UnitType       = row[ostkD.UnitType].ToString();
                itm1.Alert          = row[ostkD.Alert].ToString();
                itm1.QTY            = row[ostkD.QTY].ToString();
                itm1.PendingQTY     = row[ostkD.PendingQTY].ToString();
                itm1.Price          = row[ostkD.Price].ToString();
                itm1.drug_caution   = row[ostkD.drug_caution].ToString();
                itm1.active         = row[ostkD.active].ToString();
                itm1.remark         = row[ostkD.remark].ToString();
                itm1.date_create    = row[ostkD.date_create].ToString();
                itm1.date_modi      = row[ostkD.date_modi].ToString();
                itm1.date_cancel    = row[ostkD.date_cancel].ToString();
                itm1.user_create    = row[ostkD.user_create].ToString();
                itm1.user_modi      = row[ostkD.user_modi].ToString();
                itm1.instruction_id = row[ostkD.instruction_id].ToString();
                itm1.frequency_id   = row[ostkD.frequency_id].ToString();
                itm1.trade_name     = row[ostkD.trade_name].ToString();
                itm1.comm_name      = row[ostkD.comm_name].ToString();
                itm1.cust_id        = row[ostkD.cust_id].ToString();
                lstkD.Add(itm1);
            }
            return(lstkD);
        }