Beispiel #1
0
        public String update(OldAgent p, String userId)
        {
            String re  = "";
            String sql = "";
            int    chk = 0;

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


            sql = "Update " + oAgn.table + " Set " +
                  " " + oAgn.agentname + " = '" + p.agentname.Replace("'", "''") + "'" +
                  "," + oAgn.agent_code + " = '" + p.agent_code.Replace("'", "''") + "'" +
                  "," + oAgn.date_modi + " = now()" +
                  "," + oAgn.user_modi + " = '" + userId.Replace("'", "''") + "'" +
                  "," + oAgn.agent_email + " = '" + p.agent_email.Replace("'", "''") + "'" +
                  "Where " + oAgn.pkField + "='" + p.agentid + "'"
            ;

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

            return(re);
        }
Beispiel #2
0
        public String insert(OldAgent p, String userId)
        {
            String re  = "";
            String sql = "";

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

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

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

            return(re);
        }
Beispiel #3
0
        private void initConfig()
        {
            agn    = new OldAgent();
            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");
            }

            bg = txtAgnCode.BackColor;
            fc = txtAgnCode.ForeColor;
            ff = txtAgnCode.Font;
            txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp;
            btnNew.Click          += BtnNew_Click;
            btnSave.Click         += BtnSave_Click;
            btnEdit.Click         += BtnEdit_Click;
            btnClose.Click        += BtnClose_Click;
            btnVoid.Click         += BtnVoid_Click;

            initGrfAgent();
            setGrfAgent();
            setControlEnable(false);
            setFocusColor();
            sB1.Text = "";
            btnVoid.Hide();
            txtPasswordVoid.Hide();
            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
            //stt.BackgroundGradient = C1.Win.C1SuperTooltip.BackgroundGradient.Gold;
        }
Beispiel #4
0
 private void setControl(String posiId)
 {
     agn               = ic.ivfDB.oAgnDB.selectByPk1(posiId);
     txtID.Value       = agn.agentid;
     txtAgnCode.Value  = agn.agent_code;
     txtAgnNameT.Value = agn.agentname;
     txtAgnEmail.Value = agn.agent_email;
     //txtPosiNameT.Value = agn.posi_name_t;
     //txtRemark.Value = agn.remark;
     //if (posi.status_doctor.Equals("1"))
     //{
     //    chkStatusDoctor.Checked = true;
     //}
     //else
     //{
     //    chkStatusDoctor.Checked = false;
     //}
     //if (posi.status_embryologist.Equals("1"))
     //{
     //    chkEmbryologist.Checked = true;
     //}
     //else
     //{
     //    chkEmbryologist.Checked = false;
     //}
 }
Beispiel #5
0
        public OldAgent selectByPk1(String copId)
        {
            OldAgent  cop1 = new OldAgent();
            DataTable dt   = new DataTable();
            String    sql  = "select oAgn.* " +
                             "From " + oAgn.table + " oAgn " +
                             //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                             "Where oAgn." + oAgn.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setAgent(dt);
            return(cop1);
        }
Beispiel #6
0
        public String insertAgent(OldAgent p, String userId)
        {
            String re = "";

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

            return(re);
        }
Beispiel #7
0
        public void getlAgent()
        {
            //lDept = new List<Position>();
            loAgn.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                OldAgent itm1 = new OldAgent();
                itm1.agentid     = row[oAgn.agentid].ToString();
                itm1.agentname   = row[oAgn.agentname].ToString();
                itm1.agent_email = row[oAgn.agent_email].ToString();
                loAgn.Add(itm1);
            }
        }
Beispiel #8
0
        private void initConfig()
        {
            loAgn            = new List <OldAgent>();
            oAgn             = new OldAgent();
            oAgn.agentid     = "AgentID";
            oAgn.agentname   = "AgentName";
            oAgn.date_cancel = "date_cancel";
            oAgn.date_create = "date_create";
            oAgn.date_modi   = "date_modi";
            oAgn.user_cancel = "user_cancel";
            oAgn.user_create = "user_create";
            oAgn.user_modi   = "user_modi";
            oAgn.active      = "active";
            oAgn.remark      = "remark";
            oAgn.sort1       = "sort1";
            oAgn.agent_code  = "agent_code";
            oAgn.agent_email = "agent_email";

            oAgn.pkField = "AgentID";
            oAgn.table   = "Agent";
        }
Beispiel #9
0
        private OldAgent setAgent(DataTable dt)
        {
            OldAgent dept1 = new OldAgent();

            if (dt.Rows.Count > 0)
            {
                dept1.agentid     = dt.Rows[0][oAgn.agentid].ToString();
                dept1.agentname   = dt.Rows[0][oAgn.agentname].ToString();
                dept1.agent_code  = dt.Rows[0][oAgn.agent_code].ToString();
                dept1.remark      = dt.Rows[0][oAgn.remark].ToString();
                dept1.agent_email = dt.Rows[0][oAgn.agent_email].ToString();
            }
            else
            {
                dept1.agentid     = "";
                dept1.agentname   = "";
                dept1.remark      = "";
                dept1.agent_code  = "";
                dept1.agent_email = "";
            }

            return(dept1);
        }