示例#1
0
        public void update(CUser p_data)
        {
            string l_Sql = "";

            l_Sql += "update [KG].[dbo].[tbUser] set ";
            l_Sql += "  f_password = '******'";
            l_Sql += ", f_username = '******'";
            l_Sql += ", f_branchid = '" + p_data.f_branchid所別 + "'";
            l_Sql += ", f_lvl = " + p_data.f_lvl等級 + "";
            l_Sql += " where f_userid ='" + p_data.f_userid帳號 + "'";
            ivContext.資料管理員.excuteSqlNonquery(l_Sql);
        }
示例#2
0
        public void insert(CUser p_data)
        {
            string l_Sql = "";

            l_Sql += "INSERT INTO [KG].[dbo].[tbUser] VALUES (";
            l_Sql += " '" + p_data.f_userid帳號 + "'";
            l_Sql += ", '" + p_data.f_password密碼 + "'";
            l_Sql += ", '" + p_data.f_username姓名 + "'";
            l_Sql += ", '" + p_data.f_branchid所別 + "'";
            l_Sql += ",  " + p_data.f_lvl等級 + "";
            l_Sql += ")";
            ivContext.資料管理員.excuteSqlNonquery(l_Sql);
        }
示例#3
0
        public 特販審核[] getAll特販審核s(string p_strMonth, CUser l_user, string p_branchid)
        {
            string l_strSql = "SELECT * FROM kdreward..customer";

            //l_strSql += " where substring(convert(char(12),orderdate,111),6,2) = '" + p_strMonth + "'";
            l_strSql += " where Status='2'";

            if (l_user.f_lvl等級 == 5)//南區
            {
                l_strSql += " and BranchId in ('F04','F07','F09','F10','F14','F17','F20','F22')";

                if (!"".Equals(p_branchid))
                {
                    l_strSql += " and BranchId = '" + p_branchid + "'";
                }
            }
            else if (l_user.f_lvl等級 == 6)//北區
            {
                l_strSql += " and BranchId in ('F03','F08','F11','F12','F13','F15','F18','F27')";

                if (!"".Equals(p_branchid))
                {
                    l_strSql += " and BranchId = '" + p_branchid + "'";
                }
            }
            else
            {
                l_strSql  = "SELECT c.* FROM kdreward..customer c";
                l_strSql += " inner join tbCarSaleUp s on c.custid = s.f_custid";
                l_strSql += " where c.Status='3'";
            }
            DataView l_dv = ivContext.資料管理員.getDataViewBySql(l_strSql);

            特販審核[] l_datas = new 特販審核[l_dv.Count];

            if (l_dv != null)
            {
                for (int i = 0; i < l_datas.Length; i++)
                {
                    l_datas[i]            = create特販審核();
                    l_datas[i].custid     = Convert.ToInt32(l_dv[i]["custid"].ToString());
                    l_datas[i].CustomerId = l_dv[i]["CustomerId"].ToString();
                    l_datas[i].Name       = l_dv[i]["Name"].ToString();
                    l_datas[i].Status     = l_dv[i]["Status"].ToString();
                    l_datas[i].OrderDate  = l_dv[i]["OrderDate"].ToString();
                }
                return(l_datas);
            }
            return(null);
        }
示例#4
0
        public void update多筆沖帳(ArrayList p_al, CUser p_User, string l_strIP)
        {
            string l_Sql = "";

            l_Sql += "update [KG].[dbo].[tbInMoney] set f_isclose='Y',f_yesmoney=f_money,f_memo='" + DateTime.Now + "結清帳款,沖帳人:" + p_User.f_username姓名 + ",IP:" + l_strIP + "',f_fulldate='" + DateTime.Today.ToString("yyyy/MM/dd") + "'";
            l_Sql += " where f_workid in (";
            for (int i = 0; i < p_al.Count; i++)
            {
                l_Sql += "'" + p_al[i].ToString() + "' ,";
            }
            l_Sql  = l_Sql.Substring(0, l_Sql.Length - 1);
            l_Sql += ")";

            ivContext.資料管理員.excuteSqlNonquery(l_Sql);
        }
示例#5
0
        public 特販審核[] getAll特販審核(string p_strYear, string p_strMonth, CUser l_user, string p_status, string p_strBrachid, string p_strchiefmemo)
        {
            string l_strSql = "SELECT * FROM kdreward..customer";

            l_strSql += " where substring(convert(char(12),orderdate,111),6,2) = '" + p_strMonth + "'";
            l_strSql += " and substring(convert(char(12),orderdate,111),0,5) = '" + p_strYear + "'";
            l_strSql += " and chiefmemo = '" + p_strchiefmemo + "'";

            if (!"".Equals(p_status))
            {
                l_strSql += " and Status='" + p_status + "'";
            }
            if (l_user.f_lvl等級 == 5)//南區
            {
                l_strSql += " and BranchId in ('F04','F07','F09','F10','F14','F17','F20','F22')";
            }
            if (l_user.f_lvl等級 == 6)//北區
            {
                l_strSql += " and BranchId in ('F03','F08','F11','F12','F13','F15','F18','F27')";
            }
            if (!"".Equals(p_strBrachid))//北區
            {
                l_strSql += " and BranchId = '" + p_strBrachid + "'";
            }
            DataView l_dv = ivContext.資料管理員.getDataViewBySql(l_strSql);

            特販審核[] l_datas = new 特販審核[l_dv.Count];

            if (l_dv != null)
            {
                for (int i = 0; i < l_datas.Length; i++)
                {
                    l_datas[i]             = create特販審核();
                    l_datas[i].custid      = Convert.ToInt32(l_dv[i]["custid"].ToString());
                    l_datas[i].CustomerId  = l_dv[i]["CustomerId"].ToString();
                    l_datas[i].Name        = l_dv[i]["Name"].ToString();
                    l_datas[i].Status      = l_dv[i]["Status"].ToString();
                    l_datas[i].otherprize  = l_dv[i]["other_prize"].ToString();
                    l_datas[i].saletype    = l_dv[i]["sale_type"].ToString();
                    l_datas[i].SupportAmt  = Convert.ToDouble("0" + l_dv[i]["SupportAmt"].ToString());
                    l_datas[i].RecordDate  = l_dv[i]["RecordDate"].ToString();
                    l_datas[i].ManagerMemo = l_dv[i]["CarCenterMemo"].ToString();
                    l_datas[i].OrderDate   = l_dv[i]["OrderDate"].ToString();
                }
                return(l_datas);
            }
            return(null);
        }
示例#6
0
        /// <summary>
        /// 取得高都員工檔方便判斷
        /// </summary>
        /// <param name="p_smid"></param>
        /// <returns></returns>
        public CUser get高都員工檔(string p_smid)
        {
            string l_sql = "";

            l_sql += "select * from kdnews..T_HRPersonel where Emp_id ='" + p_smid + "'";

            DataView l_dv    = ivContext.資料管理員.getDataViewBySql(l_sql);
            CUser    l_datas = createCUser();

            if (l_dv.Count > 0)
            {
                l_datas.f_branchid所別 = l_dv[0]["Branch"].ToString();
                l_datas.f_username姓名 = l_dv[0]["Name"].ToString();
                return(l_datas);
            }
            return(null);
        }
示例#7
0
        private CUser[] queryBySql(string p_sql)
        {
            DataView l_dv = ivContext.資料管理員.getDataViewBySql(p_sql);

            CUser[] l_datas = new CUser[l_dv.Count];

            if (l_dv != null)
            {
                for (int i = 0; i < l_datas.Length; i++)
                {
                    l_datas[i]              = createCUser();
                    l_datas[i].f_userid帳號   = l_dv[i]["f_userid"].ToString();
                    l_datas[i].f_password密碼 = l_dv[i]["f_password"].ToString();
                    l_datas[i].f_username姓名 = l_dv[i]["f_username"].ToString();
                    l_datas[i].f_branchid所別 = l_dv[i]["f_branchid"].ToString();
                    l_datas[i].f_lvl等級      = Convert.ToInt32(l_dv[i]["f_lvl"].ToString());
                }
                return(l_datas);
            }
            return(null);
        }
示例#8
0
        public CUser[] getAll所別()
        {
            string l_sql = "";

            l_sql += " select f_branchid from tbUser group by f_branchid";

            DataView l_dv = ivContext.資料管理員.getDataViewBySql(l_sql);

            CUser[] l_datas = new CUser[l_dv.Count];

            if (l_dv != null)
            {
                for (int i = 0; i < l_datas.Length; i++)
                {
                    l_datas[i] = createCUser();
                    l_datas[i].f_branchid所別 = l_dv[i]["f_branchid"].ToString();
                }
                return(l_datas);
            }
            return(null);
        }
示例#9
0
        public CUser getTestEIP討論區()
        {
            string l_sql = "";

            l_sql += " select * from TB_EIP_FORUM_ARTICLE";
            l_sql += " where subject = '【2011年夏季刊_生活找樂子】高都少婦『素華』帶你吃透透~『POSITANO波西塔諾』'";
            l_sql += " order by CREATE_DATE";

            //l_sql += " select * from tbUser where f_userid ='" + p_str帳號 + "'";

            DataView l_dv    = ivContext.資料管理員.getDataViewBySql(l_sql);
            CUser    l_datas = createCUser();

            if (l_dv.Count != 0)
            {
                //for (int i = 0; i < l_datas.Length; i++)
                //{
                l_datas            = createCUser();
                l_datas.f_userid帳號 = l_dv[0]["CONTEXT"].ToString();
                //}
                return(l_datas);
            }
            return(null);
        }
示例#10
0
        public CUser getUserByUserName(string p_UserName, string p_Password)
        {
            string l_sql = "";

            l_sql += " select *";
            l_sql += " from dbo.tbUser";
            l_sql += " where f_userid = '" + p_UserName + "'";
            l_sql += " and f_password = '******'";

            DataView l_dv    = ivContext.資料管理員.getDataViewBySql(l_sql);
            CUser    l_datas = createCUser();

            if (l_dv.Count != 0)
            {
                l_datas              = createCUser();
                l_datas.f_userid帳號   = l_dv[0]["f_userid"].ToString();
                l_datas.f_password密碼 = l_dv[0]["f_password"].ToString();
                l_datas.f_username姓名 = l_dv[0]["f_username"].ToString();
                l_datas.f_branchid所別 = l_dv[0]["f_branchid"].ToString();
                l_datas.f_lvl等級      = Convert.ToInt32(l_dv[0]["f_lvl"].ToString());
                return(l_datas);
            }
            return(null);
        }