public String insert(OldCreditCardAccount p, String userId)
        {
            String re  = "";
            String sql = "";

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

            p.CreditCardName = p.CreditCardName == null ? "" : p.CreditCardName;

            sql = "Insert Into " + occa.table + " set " +
                  " " + occa.CreditCardName + " = '" + p.CreditCardName.Replace("'", "''") + "'" +
                  //"," + oca.agent_code + " = '" + p.agent_code.Replace("'", "''") + "'" +
                  "," + occa.active + " = '1'" +
                  "," + occa.date_create + " = now()" +
                  "," + occa.user_create + " = '" + userId.Replace("'", "''") + "'" +
                  " ";
            try
            {
                re = conn.ExecuteNonQuery(conn.conn, sql);
            }
            catch (Exception ex)
            {
                sql = ex.Message + " " + ex.InnerException;
            }

            return(re);
        }
        public String update(OldCreditCardAccount p, String userId)
        {
            String re  = "";
            String sql = "";
            int    chk = 0;

            p.CreditCardName = p.CreditCardName == null ? "" : p.CreditCardName;


            sql = "Update " + occa.table + " Set " +
                  " " + occa.CreditCardName + " = '" + p.CreditCardName.Replace("'", "''") + "'" +
                  //"," + oca.agent_code + " = '" + p.agent_code.Replace("'", "''") + "'" +
                  "," + occa.date_modi + " = now()" +
                  "," + occa.user_modi + " = '" + userId.Replace("'", "''") + "' " +
                  "Where " + occa.pkField + "='" + p.CreditCardID + "'"
            ;

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

            return(re);
        }
        public OldCreditCardAccount selectByPk1(String copId)
        {
            OldCreditCardAccount cop1 = new OldCreditCardAccount();
            DataTable            dt   = new DataTable();
            String sql = "select occa.* " +
                         "From " + occa.table + " occa " +
                         //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                         "Where occa." + occa.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setCreditAccount(dt);
            return(cop1);
        }
        public String insertCreditAccount(OldCreditCardAccount p, String userId)
        {
            String re = "";

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

            return(re);
        }
        public void getlCreditCardAccount()
        {
            //lDept = new List<Position>();
            lFpf.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                OldCreditCardAccount itm1 = new OldCreditCardAccount();
                itm1.CreditCardID   = row[occa.CreditCardID].ToString();
                itm1.CreditCardName = row[occa.CreditCardName].ToString();

                lFpf.Add(itm1);
            }
        }
        private void initConfig()
        {
            occa = new OldCreditCardAccount();
            lFpf = new List <OldCreditCardAccount>();
            occa.CreditCardID   = "CreditCardID";
            occa.CreditCardName = "CreditCardName";
            occa.IntLock        = "IntLock";
            occa.active         = "active";
            occa.remark         = "remark";
            occa.date_cancel    = "date_cancel";
            occa.date_create    = "date_create";
            occa.date_modi      = "date_create";
            occa.user_cancel    = "user_cancel";
            occa.user_create    = "user_create";
            occa.user_modi      = "user_modi";
            occa.receipt_print  = "receipt_print";

            occa.table   = "CreditCardAccount";
            occa.pkField = "CreditCardID";
        }
        private OldCreditCardAccount setCreditAccount(DataTable dt)
        {
            OldCreditCardAccount dept1 = new OldCreditCardAccount();

            if (dt.Rows.Count > 0)
            {
                dept1.CreditCardID   = dt.Rows[0][occa.CreditCardID].ToString();
                dept1.CreditCardName = dt.Rows[0][occa.CreditCardName].ToString();
                dept1.remark         = dt.Rows[0][occa.remark].ToString();
                dept1.IntLock        = dt.Rows[0][occa.IntLock].ToString();
                dept1.receipt_print  = dt.Rows[0][occa.receipt_print].ToString();
            }
            else
            {
                dept1.CreditCardID   = "";
                dept1.CreditCardName = "";
                dept1.remark         = "";
                dept1.IntLock        = "";
                dept1.receipt_print  = "";
            }

            return(dept1);
        }
예제 #8
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");
            color = ColorTranslator.FromHtml(ic.iniC.grfRowColor);
            oca   = new OldCashAccount();
            ocr   = new OldCreditCardAccount();

            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
            btnCaVoid.Hide();
            btnCrVoid.Hide();

            btnCaNew.Click  += BtnNew_Click;
            btnCaEdit.Click += BtnCaEdit_Click;
            btnCaSave.Click += BtnCaSave_Click;
            btnCaVoid.Click += BtnCaVoid_Click;

            btnCrNew.Click          += BtnCrNew_Click;
            btnCrEdit.Click         += BtnCrEdit_Click;
            btnCrVoid.Click         += BtnCrVoid_Click;
            btnCrSave.Click         += BtnCrSave_Click;
            chkCaVoid.Click         += ChkCaVoid_Click;
            chkCrVoid.Click         += ChkCrVoid_Click;
            txtCaPasswordVoid.KeyUp += TxtCaPasswordVoid_KeyUp;
            txtCrPasswordVoid.KeyUp += TxtCrPasswordVoid_KeyUp;

            initGrfCa();
            initGrfCr();
            setGrfCa();
            setGrfCr();
        }
예제 #9
0
 private void setControlCr(String posiId)
 {
     ocr              = ic.ivfDB.ocrDB.selectByPk1(posiId);
     txtCrID.Value    = ocr.CreditCardID;
     txtCrNameT.Value = ocr.CreditCardName;
 }