예제 #1
0
        public String insert(LabProcedure p, String userId)
        {
            String re  = "";
            String sql = "";

            p.active = "1";

            chkNull(p);

            sql = "Insert Into " + proce.table + "(" + proce.proce_code + "," + proce.proce_name_t + "," + proce.status_lab + "," +
                  proce.proce_name_e + "," + proce.remark + "," + proce.date_create + "," +
                  proce.date_modi + "," + proce.date_cancel + "," + proce.user_create + "," +
                  proce.user_modi + "," + proce.user_cancel + "," + proce.active + " " +
                  ") " +
                  "Values ('" + p.proce_code + "','" + p.proce_name_t.Replace("'", "''") + "','" + p.status_lab + "'," +
                  "'" + p.proce_name_e + "','" + 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);
        }
예제 #2
0
        public String update(LabProcedure p, String userId)
        {
            String re  = "";
            String sql = "";

            chkNull(p);

            sql = "Update " + proce.table + " Set " +
                  " " + proce.proce_code + " = '" + p.proce_code + "'" +
                  "," + proce.proce_name_t + " = '" + p.proce_name_t.Replace("'", "''") + "'" +
                  "," + proce.status_lab + " = '" + p.status_lab + "'" +
                  "," + proce.proce_name_e + " = '" + p.proce_name_e + "'" +
                  "," + proce.remark + " = '" + p.remark.Replace("'", "''") + "'" +
                  "," + proce.date_modi + " = now()" +
                  "," + proce.user_modi + " = '" + userId + "'" +
                  "Where " + proce.pkField + "='" + p.proce_id + "'"
            ;

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

            return(re);
        }
예제 #3
0
 private void setControl(String deptId)
 {
     proce               = ic.ivfDB.proceDB.selectByPk1(deptId);
     txtID.Value         = proce.proce_id;
     txtProceCode.Value  = proce.proce_code;
     txtProceNameT.Value = proce.proce_name_t;
     txtRemark.Value     = proce.remark;
 }
예제 #4
0
        public LabProcedure selectByPk1(String copId)
        {
            LabProcedure cop1 = new LabProcedure();
            DataTable    dt   = new DataTable();
            String       sql  = "select dept.* " +
                                "From " + proce.table + " dept " +
                                //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                                "Where dept." + proce.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setLabProcedure(dt);
            return(cop1);
        }
예제 #5
0
        public String insertLabProcedure(LabProcedure p, String userId)
        {
            String re = "";

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

            return(re);
        }
예제 #6
0
        private void chkNull(LabProcedure p)
        {
            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.proce_code   = p.proce_code == null ? "" : p.proce_code;
            p.proce_name_e = p.proce_name_e == null ? "" : p.proce_name_e;
            p.proce_name_t = p.proce_name_t == null ? "" : p.proce_name_t;
            p.remark       = p.remark == null ? "" : p.remark;
            p.sort1        = p.sort1 == null ? "" : p.sort1;

            p.status_lab = p.status_lab == null ? "0" : p.status_lab;
        }
예제 #7
0
        private void initConfig()
        {
            proce  = new LabProcedure();
            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 panel3.Controls)
            {
                theme1.SetTheme(c, "Office2013Red");
            }

            bg = txtProceCode.BackColor;
            fc = txtProceCode.ForeColor;
            ff = txtProceCode.Font;

            txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp;
            chkVoid.Click         += ChkVoid_Click;
            btnVoid.Click         += BtnVoid_Click;
            btnNew.Click          += BtnNew_Click;
            btnEdit.Click         += BtnEdit_Click;
            btnSave.Click         += BtnSave_Click;

            initGrfDept();
            setGrfDeptH();
            setControlEnable(false);
            setFocusColor();
            sB1.Text = "";
            btnVoid.Hide();
            txtPasswordVoid.Hide();
            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
            label1.Hide();
            txtProceCode.Hide();
            //stt.BackgroundGradient = C1.Win.C1SuperTooltip.BackgroundGradient.Gold;
        }
예제 #8
0
        private LabProcedure setLabProcedure(DataTable dt)
        {
            LabProcedure proce1 = new LabProcedure();

            if (dt.Rows.Count > 0)
            {
                proce1.proce_id     = dt.Rows[0][proce.proce_id].ToString();
                proce1.proce_code   = dt.Rows[0][proce.proce_code].ToString();
                proce1.proce_name_t = dt.Rows[0][proce.proce_name_t].ToString();
                proce1.status_lab   = dt.Rows[0][proce.status_lab].ToString();
                proce1.proce_name_e = dt.Rows[0][proce.proce_name_e].ToString();
                proce1.remark       = dt.Rows[0][proce.remark].ToString();
                proce1.date_create  = dt.Rows[0][proce.date_create].ToString();
                proce1.date_modi    = dt.Rows[0][proce.date_modi].ToString();
                proce1.date_cancel  = dt.Rows[0][proce.date_cancel].ToString();
                proce1.user_create  = dt.Rows[0][proce.user_create].ToString();
                proce1.user_modi    = dt.Rows[0][proce.user_modi].ToString();
                proce1.user_cancel  = dt.Rows[0][proce.user_cancel].ToString();
                proce1.active       = dt.Rows[0][proce.active].ToString();
            }

            return(proce1);
        }
예제 #9
0
        private void initConfig()
        {
            proce              = new LabProcedure();
            proce.proce_id     = "proce_id";
            proce.proce_code   = "proce_code";
            proce.proce_name_t = "proce_name_t";
            proce.status_lab   = "status_lab";  //1=opu, 2=fet
            proce.proce_name_e = "proce_name_e";
            proce.remark       = "remark";
            proce.date_create  = "date_create";
            proce.date_modi    = "date_modi";
            proce.date_cancel  = "date_cancel";
            proce.user_create  = "user_create";
            proce.user_modi    = "user_modi";
            proce.user_cancel  = "user_cancel";
            proce.active       = "active";
            proce.sort1        = "sort1";

            proce.table   = "lab_b_procedure";
            proce.pkField = "proce_id";

            //lDept = new List<LabProcedure>();
            //getlDept();
        }