Exemple #1
0
        public String insert(FoodsRecommend p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + foor.table + " set " +
                  " " + foor.foods_name + " = '" + p.foods_name.Replace("'", "''") + "'" +
                  "," + foor.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + foor.date_create + " = now()" +
                  "," + foor.active + " = '1'" +
                  "," + foor.user_create + " = '" + userId + "' " +
                  "," + foor.host_id + " = '" + p.host_id + "' " +
                  "," + foor.branch_id + " = '" + p.branch_id + "' " +
                  "," + foor.device_id + " = '" + p.device_id + "' " +

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

            return(re);
        }
        public String insert(OrderSpecial p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + foos.table + " set " +
                  " " + foos.order_id + " = '" + p.order_id + "'" +
                  "," + foos.foods_spec_id + " = '" + p.foods_spec_id.Replace("'", "''") + "'" +
                  "," + foos.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + foos.date_create + " = now()" +
                  "," + foos.active + " = '1'" +
                  "," + foos.user_create + " = '" + userId + "' " +
                  "," + foos.host_id + " = '" + p.host_id + "' " +
                  "," + foos.branch_id + " = '" + p.branch_id + "' " +
                  "," + foos.device_id + " = '" + p.device_id + "' " +
                  "," + foos.row1 + " = '" + p.row1 + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                //sql = ex.Message + " " + ex.InnerException;
                new LogFile("OrderSpecialDB -> insert " + ex.Message + " " + ex.InnerException + " \n sql " + sql);
            }

            return(re);
        }
Exemple #3
0
        public String insert(MaterialRec p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + matr.table + " set " +
                  " " + matr.matr_code + " = '" + p.matr_code + "'" +
                  "," + matr.matr_date + " = '" + p.matr_date.Replace("'", "''") + "'" +
                  "," + matr.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + matr.date_create + " = now()" +
                  "," + matr.active + " = '1'" +
                  "," + matr.user_create + " = '" + userId + "' " +
                  "," + matr.host_id + " = '" + p.host_id + "' " +
                  "," + matr.branch_id + " = '" + p.branch_id + "' " +
                  "," + matr.device_id + " = '" + p.device_id + "' " +
                  "," + matr.year_id + " = year(now()) " +
                  "," + matr.status_stock + " = '" + p.status_stock + "' " +
                  "," + matr.status_stock_year + " = '" + p.status_stock_year + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Exemple #4
0
        public String insert(Area p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + area.table + " set " +
                  " " + area.area_code + " = '" + p.area_code + "'" +
                  "," + area.area_name + " = '" + p.area_name.Replace("'", "''") + "'" +
                  "," + area.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + area.date_create + " = now()" +
                  "," + area.active + " = '1'" +
                  "," + area.user_create + " = '" + userId + "' " +
                  "," + area.host_id + " = '" + p.host_id + "' " +
                  "," + area.branch_id + " = '" + p.branch_id + "' " +
                  "," + area.device_id + " = '" + p.device_id + "' " +
                  "," + area.status_aircondition + " = '" + p.status_aircondition + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String insert(Restaurant p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + res.table + " set " +
                  " " + res.res_code + " = '" + p.res_code + "'" +
                  "," + res.res_name + " = '" + p.res_name.Replace("'", "''") + "'" +
                  "," + res.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + res.date_create + " = now()" +
                  "," + res.active + " = '1'" +
                  "," + res.user_create + " = '" + userId + "' " +
                  "," + res.host_id + " = '" + p.host_id + "' " +
                  "," + res.branch_id + " = '" + p.branch_id + "' " +
                  "," + res.device_id + " = '" + p.device_id + "' " +
                  "," + res.receipt_footer1 + " = '" + p.receipt_footer1.Replace("'", "''") + "' " +
                  "," + res.receipt_header2 + " = '" + p.receipt_header2.Replace("'", "''") + "' " +
                  "," + res.receipt_header1 + " = '" + p.receipt_header1.Replace("'", "''") + "' " +
                  "," + res.receipt_footer2 + " = '" + p.receipt_footer2.Replace("'", "''") + "' " +
                  "," + res.bill_code + " = '" + p.bill_code + "' " +
                  "," + res.bill_month + " = '" + p.bill_month + "' " +
                  "," + res.tax_id + " = '" + p.tax_id + "' " +
                  "," + res.printer_foods1 + " = '" + p.printer_foods1.Replace("'", "''") + "' " +
                  "," + res.printer_foods2 + " = '" + p.printer_foods2.Replace("'", "''") + "' " +
                  "," + res.printer_foods3 + " = '" + p.printer_foods3.Replace("'", "''") + "' " +
                  "," + res.printer_waterbar1 + " = '" + p.printer_waterbar1.Replace("'", "''") + "' " +
                  "," + res.printer_waterbar2 + " = '" + p.printer_waterbar2.Replace("'", "''") + "' " +
                  "," + res.printer_waterbar3 + " = '" + p.printer_waterbar3.Replace("'", "''") + "' " +
                  "," + res.receipt_footer3 + " = '" + p.receipt_footer3.Replace("'", "''") + "' " +
                  "," + res.receipt_header3 + " = '" + p.receipt_header3.Replace("'", "''") + "' " +
                  "," + res.cop_id + " = '" + p.cop_id + "' " +
                  "," + res.status_print_order + " = '" + p.status_print_order + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String insert(Position p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";
            //p.ssdata_id = "";
            int chk = 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.posi_name_e         = p.posi_name_e == null ? "" : p.posi_name_e;
            p.posi_name_t         = p.posi_name_t == null ? "" : p.posi_name_t;
            p.sort1               = p.sort1 == null ? "" : p.sort1;
            p.remark              = p.remark == null ? "" : p.remark;
            p.status_embryologist = p.status_embryologist == null ? "" : p.status_embryologist;

            //p.posi_name_e = int.TryParse(p.comp_id, out chk) ? chk.ToString() : "0";
            p.posi_id       = int.TryParse(p.posi_id, out chk) ? chk.ToString() : "0";
            p.status_doctor = int.TryParse(p.status_doctor, out chk) ? chk.ToString() : "0";
            //p.status_embryologist = int.TryParse(p.status_embryologist, out chk) ? chk.ToString() : "0";

            sql = "Insert Into " + posi.table + "(" + posi.posi_code + "," + posi.posi_name_t + "," + posi.posi_name_e + "," +
                  posi.sort1 + "," + posi.remark + "," + posi.date_create + "," +
                  posi.date_modi + "," + posi.date_cancel + "," + posi.user_create + "," +
                  posi.user_modi + "," + posi.user_cancel + "," + posi.active + ", " +
                  posi.status_doctor + "," + posi.status_embryologist + " " +
                  ") " +
                  "Values ('" + p.posi_code + "','" + p.posi_name_t.Replace("'", "''") + "','" + p.posi_name_e + "'," +
                  "'" + p.sort1 + "','" + p.remark.Replace("'", "''") + "',now()," +
                  "'" + p.date_modi + "','" + p.date_cancel + "','" + userId + "'," +
                  "'" + p.user_modi + "','" + p.user_cancel + "','" + p.active + "', " +
                  "'" + p.status_doctor + "','" + p.status_embryologist + "' " +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Exemple #7
0
        public String insert(Foods p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + foo.table + " set " +
                  " " + foo.foods_code + " = '" + p.foods_code + "'" +
                  "," + foo.foods_name + " = '" + p.foods_name.Replace("'", "''") + "'" +
                  "," + foo.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + foo.date_create + " = now()" +
                  "," + foo.active + " = '1'" +
                  "," + foo.user_create + " = '" + userId + "' " +
                  "," + foo.host_id + " = '" + p.host_id + "' " +
                  "," + foo.branch_id + " = '" + p.branch_id + "' " +
                  "," + foo.device_id + " = '" + p.device_id + "' " +
                  "," + foo.res_code + " = '" + p.res_code + "' " +
                  "," + foo.status_foods + " = '" + p.status_foods + "' " +
                  "," + foo.printer_name + " = '" + p.printer_name + "' " +
                  "," + foo.foods_price + " = '" + p.foods_price + "' " +
                  "," + foo.status_dine_in + " = '" + p.status_dine_in + "' " +
                  "," + foo.status_to_go + " = '" + p.status_to_go + "' " +
                  "," + foo.foods_cat_id + " = '" + p.foods_cat_id + "' " +
                  "," + foo.filename + " = '" + p.filename + "' " +
                  "," + foo.status_recommend + " = '" + p.status_recommend + "' " +
                  "," + foo.status_create + " = '0' " +
                  "," + foo.price_plus_togo + " = '" + p.price_plus_togo + "' " +
                  "," + foo.foods_name_1 + " = '" + p.foods_name_1 + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Exemple #8
0
        public String insert(BillDetail p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + bild.table + " set " +
                  " " + bild.bill_id + " = '" + p.bill_id + "'" +
                  "," + bild.order_id + " = '" + p.order_id.Replace("'", "''") + "'" +
                  "," + bild.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + bild.date_create + " = now()" +
                  "," + bild.active + " = '1'" +
                  "," + bild.user_create + " = '" + userId + "' " +
                  "," + bild.host_id + " = '" + p.host_id + "' " +
                  "," + bild.branch_id + " = '" + p.branch_id + "' " +
                  "," + bild.device_id + " = '" + p.device_id + "' " +
                  "," + bild.foods_id + " = '" + p.foods_id + "' " +
                  "," + bild.price + " = '" + p.price + "' " +
                  "," + bild.foods_code + " = '" + p.foods_code + "' " +
                  "," + bild.status_void + " = '" + p.status_void + "' " +
                  "," + bild.qty + " = '" + p.qty + "' " +
                  "," + bild.amount + " = '" + p.amount + "' " +
                  //"," + bil.foods_cat_id + " = '" + p.foods_cat_id + "' " +
                  //"," + bil.filename + " = '" + p.filename + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogFile("BillDetail -> insert" + ex.Message + " " + ex.InnerException);
            }

            return(re);
        }
Exemple #9
0
        public String insert(OrderMaterial p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + foom.table + " set " +
                  " " + foom.weight + " = '" + p.weight + "'" +
                  "," + foom.material_name + " = '" + p.material_name.Replace("'", "''") + "'" +
                  "," + foom.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + foom.date_create + " = now()" +
                  "," + foom.active + " = '1'" +
                  "," + foom.user_create + " = '" + userId + "' " +
                  "," + foom.host_id + " = '" + p.host_id + "' " +
                  "," + foom.branch_id + " = '" + p.branch_id + "' " +
                  "," + foom.device_id + " = '" + p.device_id + "' " +
                  "," + foom.price + " = '" + p.price + "' " +
                  "," + foom.sort1 + " = '" + p.sort1 + "' " +
                  "," + foom.qty + " = '" + p.qty + "' " +
                  "," + foom.material_id + " = '" + p.material_id + "' " +
                  "," + foom.foods_id + " = '" + p.foods_id + "' " +
                  "," + foom.order_id + " = '" + p.order_id + "' " +
                  "," + foom.foods_name + " = '" + p.foods_name.Replace("'", "''") + "' " +
                  "," + foom.foods_material_id + " = '" + p.foods_material_id + "' " +
                  ";";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Exemple #10
0
        public String insert(StockCard p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + stkc.table + " set " +
                  " " + stkc.material_id + " = '" + p.material_id + "'" +
                  "," + stkc.price + " = '" + p.price.Replace("'", "''") + "'" +
                  "," + stkc.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + stkc.date_create + " = now()" +
                  "," + stkc.qty + " = '1'" +
                  "," + stkc.user_create + " = '" + userId + "' " +
                  "," + stkc.host_id + " = '" + p.host_id + "' " +
                  "," + stkc.branch_id + " = '" + p.branch_id + "' " +
                  "," + stkc.device_id + " = '" + p.device_id + "' " +
                  "," + stkc.price + " = '" + p.price + "' " +
                  "," + stkc.rec_draw_matr_id + " = '" + p.rec_draw_matr_id + "' " +
                  "," + stkc.weight + " = '" + p.weight + "' " +
                  "," + stkc.sort1 + " = '" + p.sort1 + "' " +
                  "," + stkc.status_rec_draw + " = '" + p.status_rec_draw + "' " +
                  "," + stkc.rec_draw_date + " = '" + p.rec_draw_date + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String insert(MaterialRecDetail p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + matrd.table + " set " +
                  " " + matrd.weight + " = '" + p.weight + "'" +
                  "," + matrd.matr_id + " = '" + p.matr_id.Replace("'", "''") + "'" +
                  "," + matrd.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + matrd.date_create + " = now()" +
                  "," + matrd.active + " = '1'" +
                  "," + matrd.user_create + " = '" + userId + "' " +
                  "," + matrd.host_id + " = '" + p.host_id + "' " +
                  "," + matrd.branch_id + " = '" + p.branch_id + "' " +
                  "," + matrd.device_id + " = '" + p.device_id + "' " +
                  "," + matrd.price + " = '" + p.price + "' " +
                  "," + matrd.sort1 + " = '" + p.sort1 + "' " +
                  "," + matrd.qty + " = '" + p.qty + "' " +
                  "," + matrd.material_id + " = '" + p.material_id + "' " +
                  //"," + matrd.weight + " = '" + p.weight + "' " +
                  "," + matrd.row1 + " = '" + p.row1 + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String insert(Department p, String userId)
        {
            String re = "";
            String sql = "";
            p.active = "1";
            //p.ssdata_id = "";
            long chk = 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.comp_id = long.TryParse(p.comp_id, out chk) ? chk.ToString() : "0";
            p.dept_id = long.TryParse(p.dept_id, out chk) ? chk.ToString() : "0";
            p.dept_parent_id = long.TryParse(p.dept_parent_id, out chk) ? chk.ToString() : "0";

            sql = "Insert Into " + dept.table + "(" + dept.depart_code + "," + dept.depart_name_t + "," + dept.comp_id + "," +
                dept.dept_parent_id + "," + dept.remark + "," + dept.date_create + "," +
                dept.date_modi + "," + dept.date_cancel + "," + dept.user_create + "," +
                dept.user_modi + "," + dept.user_cancel + "," + dept.active + " " +
                ") " +
                "Values ('" + p.depart_code + "','" + p.depart_name_t.Replace("'", "''") + "','" + p.comp_id + "'," +
                "'" + p.dept_parent_id + "','" + p.remark.Replace("'", "''") + "',now()," +
                "'" + p.date_modi + "','" + p.date_cancel + "','" + userId + "'," +
                "'" + p.user_modi + "','" + p.user_cancel + "','" + p.active  + "' " +
                ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return re;
        }
Exemple #13
0
        public String insert(CloseDay p, String userId)
        {
            String re  = "";
            String sql = "";

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

            //bil.table = "t_bill";
            chkNull(p);
            sql = "Insert Into " + cld.table + " set " +
                  " " + cld.amount + " = '" + p.amount + "'" +
                  "," + cld.amt_cash + " = '" + p.amt_cash + "'" +
                  "," + cld.date_create + " = now()" +
                  "," + cld.active + " = '1'" +
                  "," + cld.user_create + " = '" + userId + "' " +
                  "," + cld.host_id + " = '" + p.host_id + "' " +
                  "," + cld.branch_id + " = '" + p.branch_id + "' " +
                  "," + cld.device_id + " = '" + p.device_id + "' " +
                  "," + cld.date_cancel + " = '" + p.date_cancel + "' " +
                  "," + cld.date_modi + " = '" + p.date_modi + "' " +
                  "," + cld.user_cancel + " = '" + p.user_cancel + "' " +
                  "," + cld.user_modi + " = '" + p.user_modi + "' " +
                  "," + cld.remark + " = '" + p.remark.Replace("'", "''") + "'" +

                  "," + cld.closeday_date + " = '" + p.closeday_date + "' " +
                  "," + cld.res_id + " = '" + p.res_id + "' " +
                  "," + cld.deposit + " = '" + p.deposit + "' " +
                  "," + cld.expense_1 + " = '" + p.expense_1 + "' " +
                  "," + cld.expense_2 + " = '" + p.expense_2 + "' " +
                  "," + cld.expense_3 + " = '" + p.expense_3 + "' " +
                  "," + cld.expense_4 + " = '" + p.expense_4 + "' " +
                  "," + cld.expense_5 + " = '" + p.expense_5 + "' " +
                  "," + cld.total_cash + " = '" + p.total_cash + "' " +
                  "," + cld.amount_order + " = '" + p.amount_order + "' " +
                  "," + cld.bill_amount + " = '" + p.bill_amount + "' " +
                  "," + cld.cash_draw1 + " = '" + p.cash_draw1 + "' " +
                  "," + cld.cash_draw1_remark + " = '" + p.cash_draw1_remark.Replace("'", "''") + "' " +
                  "," + cld.cash_draw2 + " = '" + p.cash_draw2 + "' " +
                  "," + cld.cash_draw2_remark + " = '" + p.cash_draw2_remark.Replace("'", "''") + "' " +
                  "," + cld.cash_draw3 + " = '" + p.cash_draw3 + "' " +
                  "," + cld.cash_draw3_remark + " = '" + p.cash_draw3_remark.Replace("'", "''") + "' " +
                  "," + cld.cash_receive1 + " = '" + p.cash_receive1 + "' " +
                  "," + cld.cash_receive1_remark + " = '" + p.cash_receive1_remark.Replace("'", "''") + "' " +
                  "," + cld.cash_receive2 + " = '" + p.cash_receive2 + "' " +
                  "," + cld.cash_receive2_remark + " = '" + p.cash_receive2_remark.Replace("'", "''") + "' " +
                  "," + cld.cash_receive3 + " = '" + p.cash_receive3 + "' " +
                  "," + cld.cash_receive3_remark + " = '" + p.cash_receive3_remark.Replace("'", "''") + "' " +
                  "," + cld.closeday_user + " = '" + p.closeday_user + "' " +
                  "," + cld.cnt_bill + " = '" + p.cnt_bill + "' " +
                  "," + cld.cnt_order + " = '" + p.cnt_order + "' " +
                  "," + cld.discount + " = '" + p.discount + "' " +
                  "," + cld.nettotal + " = '" + p.nettotal + "' " +
                  "," + cld.service_charge + " = '" + p.service_charge + "' " +
                  "," + cld.status_void + " = '" + p.status_void + "' " +
                  "," + cld.total + " = '" + p.total + "' " +
                  "," + cld.vat + " = '" + p.vat + "' " +
                  "," + cld.void_date + " = '" + p.void_date + "' " +
                  "," + cld.void_user + " = '" + p.void_user + "' " +
                  "," + cld.weather + " = '" + p.weather + "' " +
                  "," + cld.cash_receive + " = '" + p.cash_receive + "' " +
                  "," + cld.cash_ton + " = '" + p.cash_ton + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogFile("CloseDay -> insert" + ex.Message + " " + ex.InnerException);
            }

            return(re);
        }
Exemple #14
0
        public String insert(Staff p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + stf.table + " set " +
                  " " + stf.staff_code + "='" + p.staff_code + "' " +
                  "," + stf.username + "='" + p.username + "' " +
                  "," + stf.prefix_id + "='" + p.prefix_id + "' " +
                  "," + stf.staff_fname_t + "='" + p.staff_fname_t.Replace("'", "''") + "' " +
                  "," + stf.staff_fname_e + "='" + p.staff_fname_e.Replace("'", "''") + "' " +
                  "," + stf.password1 + "='" + p.password1 + "' " +
                  "," + stf.active + "='" + p.active + "' " +
                  "," + stf.remark + "='" + p.remark.Replace("'", "''") + "' " +
                  "," + stf.priority + "='" + p.priority + "' " +
                  "," + stf.tele + "='" + p.tele + "' " +
                  "," + stf.mobile + "='" + p.mobile + "' " +
                  "," + stf.fax + "='" + p.fax + "' " +
                  "," + stf.email + "='" + p.email + "' " +
                  "," + stf.posi_id + "='" + p.posi_id + "' " +
                  "," + stf.posi_name + "='" + p.posi_name.Replace("'", "''") + "' " +
                  "," + stf.date_create + "=now() " +
                  "," + stf.date_modi + "='" + p.date_modi + "' " +
                  "," + stf.date_cancel + "='" + p.date_cancel + "' " +
                  "," + stf.user_create + "='" + userId + "' " +
                  "," + stf.user_modi + "='" + p.user_modi + "' " +
                  "," + stf.user_cancel + "='" + p.user_cancel + "' " +
                  "," + stf.staff_lname_t + "='" + p.staff_lname_t.Replace("'", "''") + "' " +
                  "," + stf.staff_lname_e + "='" + p.staff_lname_e.Replace("'", "''") + "' " +
                  ", " + stf.pid + "='" + p.pid + "' " +
                  "," + stf.logo + "='" + p.logo + "' " +
                  ", " + stf.dept_name + "='" + p.dept_name.Replace("'", "''") + "' " +
                  "," + stf.status_admin + "='" + p.status_admin + "' " +
                  ", " + stf.status_module_reception + "='" + p.status_module_reception + "' " +
                  "," + stf.status_module_nurse + "='" + p.status_module_nurse + "' " +
                  "," + stf.status_module_doctor + "='" + p.status_module_doctor + "' " +
                  "," + stf.status_expense_appv + "='" + p.status_expense_appv + "' " +
                  "," + stf.status_expense_draw + "='" + p.status_expense_draw + "' " +
                  "," + stf.status_expense_pay + "='" + p.status_expense_pay + "' " +
                  ", " + stf.status_module_pharmacy + "='" + p.status_module_pharmacy + "' " +
                  "," + stf.status_module_lab + "='" + p.status_module_lab + "' " +
                  "," + stf.dept_id + "='" + p.dept_id + "' " +
                  //"," + stf.status_module_cashier + "='" + p.status_module_cashier + "' " +
                  //"," + stf.status_module_medicalrecord + "='" + p.status_module_medicalrecord + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
Exemple #15
0
        public String insert(Company p, String userId)
        {
            String re = "", sql = "";

            p.active = "1";


            chkNull(p);
            sql = "Insert Into " + cop.table + "(" + cop.comp_code + "," + cop.comp_name_t + "," + cop.comp_name_e + "," +
                  cop.comp_address_e + "," + cop.comp_address_t + ", " + cop.addr1 + ", " +
                  cop.addr2 + "," + cop.amphur_id + ", " + cop.district_id + ", " +
                  cop.province_id + "," + cop.zipcode + ", " + cop.tele + ", " +
                  cop.fax + "," + cop.email + ", " + cop.website + ", " +
                  cop.logo + "," + cop.tax_id + ", " + cop.vat + ", " +
                  cop.spec1 + "," + cop.date_create + ", " + cop.date_modi + ", " +
                  cop.date_cancel + "," + cop.user_create + ", " + cop.user_modi + ", " +
                  cop.user_cancel + "," + cop.remark + ", " +
                  cop.qu_line1 + "," + cop.qu_line2 + ", " + cop.qu_line3 + ", " +
                  cop.qu_line4 + "," + cop.qu_line5 + ", " + cop.qu_line6 + ", " +
                  cop.inv_line1 + "," + cop.inv_line2 + ", " + cop.inv_line3 + ", " +
                  cop.inv_line4 + "," + cop.inv_line5 + ", " + cop.inv_line6 + ", " +
                  cop.po_line1 + "," + cop.po_due_period + ", " + cop.active + ", " +
                  cop.taddr1 + "," + cop.taddr2 + ", " + cop.taddr3 + ", " +
                  cop.taddr4 + "," + cop.eaddr1 + ", " + cop.eaddr2 + ", " +
                  cop.eaddr3 + "," + cop.eaddr4 + "," + cop.amount_reserve + " " +
                  ") " +
                  "Values ('" + p.comp_code + "','" + p.comp_name_t.Replace("'", "''") + "','" + p.comp_name_e.Replace("'", "''") + "'," +
                  "'" + p.comp_address_e.Replace("'", "''") + "','" + p.comp_address_t.Replace("'", "''") + "','" + p.addr1.Replace("'", "''") + "'," +
                  "'" + p.addr2.Replace("'", "''") + "','" + p.amphur_id + "','" + p.district_id + "'," +
                  "'" + p.province_id + "','" + p.zipcode + "','" + p.tele + "'," +
                  "'" + p.fax + "','" + p.email + "','" + p.website + "'," +
                  "'" + p.logo + "','" + p.tax_id + "','" + p.vat + "'," +
                  "'" + p.spec1 + "',now(),'" + p.date_modi + "'," +
                  "'" + p.date_cancel + "','" + userId + "','" + p.user_modi + "'," +
                  "'" + p.user_cancel + "','" + p.remark.Replace("'", "''") + "'," +
                  "'" + p.qu_line1 + "','" + p.qu_line2 + "','" + p.qu_line3 + "'," +
                  "'" + p.qu_line4 + "','" + p.qu_line5 + "','" + p.qu_line6 + "'," +
                  "'" + p.inv_line1 + "','" + p.inv_line2 + "','" + p.inv_line3 + "'," +
                  "'" + p.inv_line4 + "','" + p.inv_line5 + "','" + p.inv_line6 + "'," +
                  "'" + p.po_line1 + "','" + p.po_due_period + "','" + p.active + "', " +
                  "'" + p.taddr1 + "','" + p.taddr2 + "','" + p.taddr3 + "', " +
                  "'" + p.taddr4 + "','" + p.eaddr1 + "','" + p.eaddr2 + "', " +
                  "'" + p.eaddr3 + "','" + p.eaddr4 + "','" + p.amount_reserve + "' " +
                  ")";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }


            return(re);
        }
Exemple #16
0
        public String insert(Order1 p, String userId)
        {
            String re  = "";
            String sql = "";

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

            chkNull(p);
            sql = "Insert Into " + ord.table + " set " +
                  " " + ord.lot_id + " = '" + p.lot_id + "'" +
                  "," + ord.row1 + " = '" + p.row1.Replace("'", "''") + "'" +
                  "," + ord.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + ord.date_create + " = now()" +
                  "," + ord.active + " = '1'" +
                  "," + ord.user_create + " = '" + userId + "' " +
                  "," + ord.host_id + " = '" + p.host_id + "' " +
                  "," + ord.branch_id + " = '" + p.branch_id + "' " +
                  "," + ord.device_id + " = '" + p.device_id + "' " +
                  "," + ord.date_cancel + " = '" + p.date_cancel + "' " +
                  "," + ord.date_modi + " = '" + p.date_modi + "' " +
                  "," + ord.user_cancel + " = '" + p.user_cancel + "' " +
                  "," + ord.user_modi + " = '" + p.user_modi + "' " +
                  "," + ord.status_bill + " = '" + p.status_bill + "' " +
                  "," + ord.bill_check_date + " = '" + p.bill_check_date + "' " +
                  "," + ord.status_cook + " = '" + p.status_cook + "' " +
                  "," + ord.cook_receive_date + " = '" + p.cook_receive_date + "' " +
                  "," + ord.cook_finish_date + " = '" + p.cook_finish_date + "' " +
                  "," + ord.void_date + " = '" + p.void_date + "' " +
                  "," + ord.status_void + " = '" + p.status_void + "' " +
                  "," + ord.printer_name + " = '" + p.printer_name.Replace("'", "''") + "' " +
                  "," + ord.status_to_go + " = '" + p.status_to_go + "' " +
                  "," + ord.bill_id + " = '" + p.bill_id + "' " +
                  "," + ord.order_user + " = '" + p.order_user + "' " +
                  "," + ord.status_closeday + " = '" + p.status_closeday + "' " +
                  "," + ord.closeday_id + " = '" + p.closeday_id + "' " +
                  "," + ord.cnt_cust + " = '" + p.cnt_cust + "' " +
                  "," + ord.order_date + " = now() " +
                  "," + ord.table_id + " = '" + p.table_id + "' " +
                  "," + ord.price + " = '" + p.price + "' " +
                  "," + ord.foods_code + " = '" + p.foods_code + "' " +
                  "," + ord.res_id + " = '" + p.res_id + "' " +
                  "," + ord.area_id + " = '" + p.area_id + "' " +
                  "," + ord.status_foods_1 + " = '" + p.status_foods_1 + "' " +
                  "," + ord.status_foods_2 + " = '" + p.status_foods_2 + "' " +
                  "," + ord.status_foods_3 + " = '" + p.status_foods_3 + "' " +
                  "," + ord.foods_id + " = '" + p.foods_id + "' " +
                  "," + ord.foods_name + " = '" + p.foods_name.Replace("'", "''") + "' " +
                  "," + ord.price_plus_togo + " = '" + p.price_plus_togo.Replace("'", "''") + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
                new LogFile("Order -> insert" + ex.Message + " " + ex.InnerException);
            }

            return(re);
        }
Exemple #17
0
        public String insert(Bill p, String userId)
        {
            String re  = "";
            String sql = "";

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

            //bil.table = "t_bill";
            chkNull(p);
            sql = "Insert Into " + bil.table + " set " +
                  " " + bil.bill_code + " = '" + p.bill_code + "'" +
                  "," + bil.bill_date + " = '" + p.bill_date.Replace("'", "''") + "'" +
                  "," + bil.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + bil.date_create + " = now()" +
                  "," + bil.active + " = '1'" +
                  "," + bil.user_create + " = '" + userId + "' " +
                  "," + bil.host_id + " = '" + p.host_id + "' " +
                  "," + bil.branch_id + " = '" + p.branch_id + "' " +
                  "," + bil.device_id + " = '" + p.device_id + "' " +
                  "," + bil.date_cancel + " = '" + p.date_cancel + "' " +
                  "," + bil.date_modi + " = '" + p.date_modi + "' " +
                  "," + bil.user_cancel + " = '" + p.user_cancel + "' " +
                  "," + bil.user_modi + " = '" + p.user_modi + "' " +
                  "," + bil.service_charge + " = '" + p.service_charge + "' " +
                  "," + bil.vat + " = '" + p.vat + "' " +
                  "," + bil.total + " = '" + p.total + "' " +
                  "," + bil.nettotal + " = '" + p.nettotal + "' " +
                  "," + bil.cash_receive + " = '" + p.cash_receive + "' " +
                  "," + bil.cash_ton + " = '" + p.cash_ton + "' " +
                  "," + bil.void_date + " = '" + p.void_date + "' " +
                  "," + bil.bill_user + " = '" + p.bill_user + "' " +
                  "," + bil.status_closeday + " = '" + p.status_closeday + "' " +
                  "," + bil.closeday_id + " = '" + p.closeday_id + "' " +
                  "," + bil.lot_id + " = '" + p.lot_id + "' " +
                  //"," + ord.order_user + " = '" + p.order_user + "' " +
                  //"," + bil.status_closeday + " = '" + p.status_closeday + "' " +
                  //"," + bil.closeday_id + " = '" + p.closeday_id + "' " +
                  //"," + ord.cnt_cust + " = '" + p.cnt_cust + "' " +

                  "," + bil.void_user + " = '" + p.void_user + "' " +
                  "," + bil.table_id + " = '" + p.table_id + "' " +
                  //"," + bil.table_id + " = '" + p.table_id + "' " +
                  "," + bil.status_payment + " = '" + p.status_payment + "' " +
                  "," + bil.res_id + " = '" + p.res_id + "' " +
                  "," + bil.area_id + " = '" + p.area_id + "' " +
                  "," + bil.amount + " = '" + p.amount + "' " +
                  "," + bil.discount + " = '" + p.discount + "' " +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                //sql = ex.Message + " " + ex.InnerException;
                new LogFile("Bill -> insert " + ex.Message + " " + ex.InnerException + " \n sql " + sql);
            }

            return(re);
        }