예제 #1
0
        public FoodsCat selectByPk1(String copId)
        {
            FoodsCat  cop1 = new FoodsCat();
            DataTable dt   = new DataTable();
            String    sql  = "select sex.* " +
                             "From " + fooC.table + " sex " +
                             //"Left Join t_ssdata_visit ssv On ssv.ssdata_visit_id = bd.ssdata_visit_id " +
                             "Where sex." + fooC.pkField + " ='" + copId + "' ";

            dt   = conn.selectData(conn.conn, sql);
            cop1 = setFoodsCat(dt);
            return(cop1);
        }
예제 #2
0
        public String insertFoodsCat(FoodsCat p, String userId)
        {
            String re = "";

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

            return(re);
        }
예제 #3
0
        public void getlFoodsCat()
        {
            //lDept = new List<Position>();
            //lfooC.Clear();
            DataTable dt = new DataTable();

            dt = selectAll();
            foreach (DataRow row in dt.Rows)
            {
                FoodsCat itm1 = new FoodsCat();
                itm1.foods_cat_id   = row[fooC.foods_cat_id].ToString();
                itm1.foods_cat_name = row[fooC.foods_cat_name].ToString();
                itm1.filename       = row[fooC.filename].ToString();
                lfooC.Add(itm1);
            }
        }
예제 #4
0
        private FoodsCat setFoodsCat(DataTable dt)
        {
            FoodsCat dept1 = new FoodsCat();

            if (dt.Rows.Count > 0)
            {
                dept1.foods_cat_id   = dt.Rows[0][fooC.foods_cat_id].ToString();
                dept1.foods_cat_code = dt.Rows[0][fooC.foods_cat_code].ToString();
                dept1.foods_cat_name = dt.Rows[0][fooC.foods_cat_name].ToString();
                //dept1.posi_name_e = dt.Rows[0][area.posi_name_e] != null ? dt.Rows[0][area.posi_name_e].ToString() : "";
                //dept1.status_doctor = dt.Rows[0][area.status_doctor] != null ? dt.Rows[0][area.status_doctor].ToString() : "";
                dept1.remark           = dt.Rows[0][fooC.remark] != null ? dt.Rows[0][fooC.remark].ToString() : "";
                dept1.date_create      = dt.Rows[0][fooC.date_create] != null ? dt.Rows[0][fooC.date_create].ToString() : "";
                dept1.date_modi        = dt.Rows[0][fooC.date_modi] != null ? dt.Rows[0][fooC.date_modi].ToString() : "";
                dept1.date_cancel      = dt.Rows[0][fooC.date_cancel] != null ? dt.Rows[0][fooC.date_cancel].ToString() : "";
                dept1.user_create      = dt.Rows[0][fooC.user_create] != null ? dt.Rows[0][fooC.user_create].ToString() : "";
                dept1.user_modi        = dt.Rows[0][fooC.user_modi] != null ? dt.Rows[0][fooC.user_modi].ToString() : "";
                dept1.user_cancel      = dt.Rows[0][fooC.user_cancel] != null ? dt.Rows[0][fooC.user_cancel].ToString() : "";
                dept1.active           = dt.Rows[0][fooC.active] != null ? dt.Rows[0][fooC.active].ToString() : "";
                dept1.sort1            = dt.Rows[0][fooC.sort1] != null ? dt.Rows[0][fooC.sort1].ToString() : "";
                dept1.filename         = dt.Rows[0][fooC.filename] != null ? dt.Rows[0][fooC.filename].ToString() : "";
                dept1.status_recommend = dt.Rows[0][fooC.status_recommend] != null ? dt.Rows[0][fooC.status_recommend].ToString() : "";
            }
            else
            {
                dept1.foods_cat_id   = "";
                dept1.foods_cat_code = "";
                dept1.foods_cat_name = "";
                //posi.dept_parent_id = "dept_parent_id";
                dept1.remark           = "";
                dept1.date_create      = "";
                dept1.date_modi        = "";
                dept1.date_cancel      = "";
                dept1.user_create      = "";
                dept1.user_modi        = "";
                dept1.user_cancel      = "";
                dept1.active           = "";
                dept1.sort1            = "";
                dept1.filename         = "";
                dept1.status_recommend = "";
            }

            return(dept1);
        }
예제 #5
0
        private void chkNull(FoodsCat p)
        {
            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.foods_cat_name   = p.foods_cat_name == null ? "" : p.foods_cat_name;
            p.foods_cat_code   = p.foods_cat_code == null ? "" : p.foods_cat_code;
            p.filename         = p.filename == null ? "" : p.filename;
            p.status_recommend = p.status_recommend == null ? "0" : p.status_recommend;
            p.sort1            = p.sort1 == null ? "9999" : p.sort1;

            p.host_id   = long.TryParse(p.host_id, out chk) ? chk.ToString() : "0";
            p.branch_id = long.TryParse(p.branch_id, out chk) ? chk.ToString() : "0";
            p.device_id = long.TryParse(p.device_id, out chk) ? chk.ToString() : "0";
        }
예제 #6
0
        public FoodsCat getFoodsCat(String id)
        {
            String   re   = "";
            FoodsCat fooc = new FoodsCat();

            if (lfooC.Count <= 0)
            {
                getlFoodsCat();
            }
            foreach (FoodsCat sex in lfooC)
            {
                if (sex.foods_cat_id.Equals(id))
                {
                    //re = sex.foods_cat_name;
                    fooc = sex;
                    break;
                }
            }
            return(fooc);
        }
예제 #7
0
        private void initConfig()
        {
            fooC   = new FoodsCat();
            fEdit  = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Regular);
            fEditB = new Font(mposC.iniC.grdViewFontName, mposC.grdViewFontSize, FontStyle.Bold);

            //C1ThemeController.ApplicationTheme = mposC.iniC.themeApplication;
            theme1.Theme = mposC.iniC.themeApplication;
            theme1.SetTheme(sB, "BeigeOne");
            foreach (Control c in panel3.Controls)
            {
                if (c is C1PictureBox)
                {
                    continue;
                }
                theme1.SetTheme(c, mposC.iniC.themeApplication);
            }

            bg            = txtAreaCode.BackColor;
            fc            = txtAreaCode.ForeColor;
            ff            = txtAreaCode.Font;
            btnImg.Click += BtnImg_Click;

            txtPasswordVoid.KeyUp += TxtPasswordVoid_KeyUp;
            chkVoid.Click         += ChkVoid_Click;

            initGrfFoodsCat();
            setGrfFoodsCat();
            setControlEnable(false);
            setFocusColor();
            sB1.Text = "";
            btnVoid.Hide();
            txtPasswordVoid.Hide();
            stt = new C1SuperTooltip();
            sep = new C1SuperErrorProvider();
            //stt.BackgroundGradient = C1.Win.C1SuperTooltip.BackgroundGradient.Gold;
        }