Exemplo n.º 1
0
        public List <VisitBill> GetBills(string userName)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            List <VisitBill>               result = new List <VisitBill>();
            string                         date   = DateTime.Now.Date.ToString();
            clientservice_VisitBill        bills  = new clientservice_VisitBill();
            List <clientservice_VisitBill> list   = bills.Select(" and billman='" + userName + "' and  BILLDATE='" + date + "'  ", " client,billdate,notepre,code,zf3,zf4,zf5 ");//公司、拜访时间、内容、单号、名字、职位、电话

            foreach (clientservice_VisitBill b in list)
            {
                VisitBill v = new VisitBill();
                v.client      = b.CLIENT;
                v.code        = b.CODE;
                v.content     = b.NOTEPRE;
                v.date        = b.BILLDATE.ToString("yyyy-MM-dd");
                v.hisname     = b.ZF3;
                v.hisposition = b.ZF4;
                v.hisphone    = b.ZF5;
                result.Add(v);
            }
            return(result);
        }
Exemplo n.º 2
0
        public void AccountFee(string userName, string client, string code, string eating, string other, string person,
                               string traffic, string commission, string remark, string hisname, string hisphone, string note)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return;//身份验证失败
            }
            MLogin.GetExeUname();
            TreatFee t = new TreatFee();

            t.BILLCODE = ScueFun.Code.BasicCode("TreatFee", "BILLCODE", "TF");
            t.CLIENT   = client;
            t.VBCODE   = code;//拜访单单号
            t.BILLMAN  = userName;
            t.EATING   = eating;
            t.OTHER    = other;
            t.PERSON   = person;

            t.NAME  = hisname;
            t.PHONE = hisphone;
            t.NOTE  = note;

            t.TRAFFIC     = traffic;
            t.COMMISSION  = commission; //佣金申请
            t.BLANK_STR_1 = remark;     //备注,说明
            t.CREATETIME  = SysTime.GetTime.ToString("yyyy-MM-dd HH:mm:ss");
            t.STATE       = 0;          //已提交
            t.Insert();
        }
Exemplo n.º 3
0
        public List <VisitBill> P_HisVisit(string userName, int curPage, int pageSize)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);
            }
            MLogin.GetExeUname();
            int    num = curPage * pageSize;
            string sql = "select top " + pageSize.ToString() + " o.* from (  " +
                         "  select row_number() over(order by id desc) as rownumber,a.* from(  " +
                         "  select id, client, billdate, notepre, code from clientservice_VisitBill where billman = '" + userName + "') as a ) as o where rownumber> " + num.ToString();
            DataTable        dt      = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);
            List <VisitBill> history = new List <VisitBill>();

            foreach (DataRow c in dt.Rows)
            {
                VisitBill b = new VisitBill();
                b.code    = c["CODE"].ToString();
                b.client  = c["CLIENT"].ToString();
                b.date    = Convert.ToDateTime(c["BILLDATE"].ToString()).ToString("yyyy-MM-dd");
                b.content = c["NOTEPRE"].ToString();
                history.Add(b);
            }
            return(history);
        }
Exemplo n.º 4
0
        public int PoiBillAudit(string userName, string type, string id)
        {
            //审核bill
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(-1);//身份验证失败
            }
            MLogin.GetExeUname();
            L_PushPoi        n    = new L_PushPoi();
            List <L_PushPoi> list = n.Select(" and id =" + id);

            if (list.Count <= 0)
            {
                return(-1);
            }
            else
            {
                n.ZF2 = userName;                   //审核人
                n.ZF3 = SysTime.GetTime.ToString(); //审核时间
                if (type.ToUpper() == "YES")
                {
                    n.OPERATE_TYPE = "同意";
                    KFLocation.Set(list[0].BILLMAN, list[0].CLIENT, list[0].AFTER_LNG + "," + list[0].AFTER_LAT);
                }
                else
                {
                    n.OPERATE_TYPE = "否决";
                }
                return(n.Updata(" and id=" + id));
            }
        }
Exemplo n.º 5
0
        public bool AuditBills(string userName, string billcode, string opinion, string type)
        {
            bool   flag    = false;
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(flag);//身份验证失败
            }
            MLogin.GetExeUname();
            TreatFee t = new TreatFee();

            if (type == "YES")
            {
                if (opinion.Trim() == "")
                {
                    t.BLANK_STR_2 = "同意!";
                }
                t.STATE = 10;//审核成功
            }
            else
            {
                t.STATE       = -1;                         //审核失败
                t.BLANK_STR_2 = opinion;                    //审核意见
            }
            t.AUDITDATE   = System.DateTime.Now.ToString(); //审核时间
            t.BLANK_STR_3 = userName;                       //审核人名字
            t.Updata("  and BILLCODE='" + billcode + "'  ");
            flag = true;
            return(flag);
        }
Exemplo n.º 6
0
        public string Reply(int id, string reply, string userName, double lng, double lat, double kflng, double kflat)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            if (MyGlobal.AERA_CHECK)//是否检核范围
            {
                if (kflng == -1 || kflat == -1)
                {
                    return("None");
                }
                if (ScueFun.LngLatDis.GetDistance(lng, lat, kflng, kflat) > MyGlobal.VISITAERA)//超出范围
                {
                    return("Toofar");
                }
            }

            //事务处理开始,劫持链接通道的sql语句
            TransactionSql.Start(MyGlobal.DataBase);  //===>开始
            DateTime          now    = SysTime.GetTime;
            List <RpBill>     result = new List <RpBill>();
            L_ContactSheetMsg msg    = new L_ContactSheetMsg();

            msg.MTITLE     = reply;
            msg.INSERTER   = userName;
            msg.FID        = id;
            msg.INSERTDATE = now;
            msg.STATE      = "已提交";
            int get_id = msg.Insert();
            List <L_ContactSheetMsg> msg_list  = msg.Select(" and INSERTDATE='" + now.ToString() + "'  ");
            L_ContactSheet           l_Contact = new L_ContactSheet();
            List <L_ContactSheet>    list      = l_Contact.Select(" and id = " + id.ToString());

            if (list.Count > 0)
            {
                //更新关联单据号,最新的,可作为最后打卡的目标公司,名称、地址  20180904 skl
                puku_user u = new puku_user();
                u.REFERCODE = msg_list.Count > 0 ? msg_list[0].ID.ToString():"";
                u.ZF1       = list[0].CLIENT;
                u.ZF2       = kflng.ToString();
                u.ZF3       = kflat.ToString();
                u.ZF4       = now.ToString("yyyy-MM-dd HH:mm:ss");
                u.Updata(" and  TURENAME='" + userName + "'  ");
            }
            else
            {
                return("没有该联络单!");
            }
            //提交事务到sql服务器处理//===>结束
            if (!TransactionSql.EndSql())//判断是否成功
            {
                return("回复失败!");
            }
            return(msg.INSERTDATE.ToString());
        }
Exemplo n.º 7
0
        public List <VisitBill> HisVisit(string userName)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);
            }
            MLogin.GetExeUname();
            clientservice_VisitBill        bills = new clientservice_VisitBill();
            List <clientservice_VisitBill> list  = bills.Select(" and billman='" + userName + "' order by id desc ", " top 20 client,billdate,notepre,code");
            List <VisitBill> history             = new List <VisitBill>();

            foreach (clientservice_VisitBill c in list)
            {
                VisitBill b = new VisitBill();
                b.code    = c.CODE;
                b.client  = c.CLIENT;
                b.date    = c.BILLDATE.ToString("yyyy-MM-dd");
                b.content = c.NOTEPRE;
                history.Add(b);
            }
            return(history);
        }
Exemplo n.º 8
0
        public List <LLBill> NeighborBill(string id, string userName, double lng, double lat, int curPage, int pageSize)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            DataTable     dt     = Function.NeighbourBill(curPage, pageSize, lng, lat);
            List <LLBill> result = new List <LLBill>();

            foreach (DataRow row in dt.Rows)
            {
                LLBill n = new LLBill();
                n.id        = row["ID"].ToString();                                                   //客户
                n.client    = row["CLIENT"].ToString();                                               //客户
                n.code      = row["CODE"].ToString();                                                 //单号
                n.depar     = row["DEPAR"].ToString();                                                //部门
                n.finshdate = Convert.ToDateTime(row["FINSHDATE"].ToString()).ToString("yyyy-MM-dd"); //要求完成时间
                n.id        = row["ID"].ToString();
                n.inserter  = row["INSERTER"].ToString();                                             //提出人
                n.machinecn = row["MACHINECN"].ToString();                                            //机床编号
                n.mtitle    = row["MTITLE"].ToString();                                               //内容
                n.type      = row["TYPE"].ToString();                                                 //状态
                n.distance  = row["DISTANCE"].ToString() + "km";                                      //距离
                n.contactor = row["CONTACTOR"].ToString();                                            //联系人
                n.phone     = row["PHONE"].ToString();                                                //电话
                n.lng       = row["ZF29"].ToString();                                                 //经度
                n.lat       = row["ZF30"].ToString();                                                 //纬度
                result.Add(n);
            }
            return(result);
        }
Exemplo n.º 9
0
        public List <RpBill> GetReply(string fid)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            List <RpBill>            result = new List <RpBill>();
            L_ContactSheetMsg        msg    = new L_ContactSheetMsg();
            List <L_ContactSheetMsg> list   = msg.Select("  and  fid='" + fid + "' order by id desc ", " top 30 * ");

            foreach (L_ContactSheetMsg r in list)
            {
                RpBill n = new RpBill();
                n.createtime = r.INSERTDATE.ToString("yyyy-MM-dd HH:mm:ss");
                n.state      = r.STATE;
                n.inserter   = r.INSERTER;
                n.content    = r.MTITLE;
                result.Add(n);
            }
            return(result);
        }
Exemplo n.º 10
0
        public VSBill YW_Detail_Bill(string code)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            L_VisitSend s  = new L_VisitSend();
            VSBill      vs = new VSBill();
            //未接收消息
            List <L_VisitSend> list = s.Select(" and CODE='" + code + "' ");

            if (list.Count <= 0)
            {
                return(null);//没有未接收消息
            }
            else
            {
                L_VisitSend l = list[0];
                vs.id        = l.ID;
                vs.client    = l.VISITCLIENT;
                vs.hisname   = l.VISITNAME;
                vs.hisphone  = l.VISITTEL;
                vs.content   = l.VISITCONTENT;
                vs.notice    = l.DOTHING;
                vs.visittype = l.VISITTYPE;
                vs.date      = l.VISITDATE.ToShortDateString();
                vs.state     = l.STATE;
                vs.code      = l.CODE;
            }
            return(vs);
        }
Exemplo n.º 11
0
        public List <KfkfCode> KFKF(string userId, string searchName)
        {
            //读取客户  用于客户搜索框
            List <KfkfCode> ls      = new List <KfkfCode>();
            string          cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string          session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                KfkfCode C = new KfkfCode();
                C.NAME = "session:" + session;
                ls.Add(C);
                KfkfCode C2 = new KfkfCode();
                C2.NAME = "cookies:" + cookies;
                ls.Add(C2);
                return(ls);
            }
            MLogin.GetExeUname();
            string sql = "  select top 30 NAME,CONTACTOR,PHONE from ClientService_kfku where id in (select max(id) from ClientService_kfku group by name)   " +
                         "  group by  NAME,CONTACTOR,PHONE  " +
                         " HAVING NAME like '%" + searchName + "%' or CONTACTOR like '%" + searchName + "%' or  PHONE like '%" + searchName + "%' ";
            DataTable table = (DataTable)BLL.SqltoView(MyGlobal.DataBase, BLL.数据类型.Table, sql);

            foreach (DataRow r in table.Rows)
            {
                KfkfCode C = new KfkfCode();
                C.NAME = r["NAME"].ToString();
                ls.Add(C);
            }
            return(ls);
        }
Exemplo n.º 12
0
        public int Sign(string userName, string userId, string type, double lng, double lat)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(-10);//身份验证失败
            }
            MLogin.GetExeUname();
            if (type.ToUpper() == "SIGNIN")
            {
                return(SignCS.SignIn(userName, userId, lng, lat));
            }
            else if (type.ToUpper() == "SIGNOUT")
            {
                return(SignCS.SignOut(userName, userId, lng, lat));
            }
            else if (type != "")
            {
                if (MyGlobal.SignType)//区分签到签退
                {
                    return(SignCS.Sign_P(userName, userId, lng, lat, type));
                }
                else
                {
                    return(SignCS.Sign_P(userName, userId, lng, lat, ""));
                }
            }
            else
            {
                return(-10);//身份验证失败
            }
        }
Exemplo n.º 13
0
        public bool Upload()
        {
            try
            {
                string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
                string session = Session.SessionID.ToString();
                if (!cookies.Equals(session))
                {
                    return(false);//身份验证失败
                }
                MLogin.GetExeUname();
                System.Web.HttpContext.Current.Response.ContentType = "image/jpeg";
                //var file = System.Web.HttpContext.Current.Request.Files[0];
                //if(file.FileName == "")
                //{
                //    return "filename为空!";
                //}
                string result  = null;
                string result2 = null;
                result  = System.Web.HttpContext.Current.Request["value1"];
                result2 = System.Web.HttpContext.Current.Request["value2"];

                HttpPostedFile f         = System.Web.HttpContext.Current.Request.Files[0];
                Random         rad       = new Random();          //实例化随机数产生器rad;
                int            value     = rad.Next(1000, 10000); //用rad生成大于等于1000,小于等于9999的随机数;
                string         file_name = System.DateTime.Now.ToString("yyyyMMddHHmmss") + "_" + result + "_" + value.ToString() + ".jpg";

                // f.SaveAs(Server.MapPath(file_name));

                byte[] bytes = StreamToBytes(f.InputStream);

                //将需要存储的图片读取为数据流
                // FileStream fileStream = new FileStream(Server.MapPath(file_name), FileMode.Open, FileAccess.Read);
                //BinaryReader binaryReader = new BinaryReader(fileStream);
                //byte[] res = binaryReader.ReadBytes(Convert.ToInt32(fileStream.Length));
                //binaryReader.Close();
                //fileStream.Close();
                IBLL.售后附件(bytes, file_name, result2, result);
                return(true);
                // return string.IsNullOrEmpty(result) ? "" : result;
            }
            catch (Exception ex)
            {
                return(false);
            }

            //Stream s = System.Web.HttpContext.Current.Request.InputStream;
            //byte[] b = new byte[s.Length];
            //s.Read(b, 0, (int)s.Length);
            //Encoding.UTF8.GetString(b);

            //string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            //string session = Session.SessionID.ToString();
            //if (!cookies.Equals(session))
            //{
            //    return null;//身份验证失败
            //}
            //MLogin.GetExeUname();
        }
Exemplo n.º 14
0
        public List <PushPoi> AuditPoi(string userName, int curPage, int pageSize)
        {
            //获得bill
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            int num = curPage * pageSize;

            string where = "";
            string sql = "";

            if (userName == "郑昌仁")
            {
                where = " and zf1='总经办' ";
            }
            else if (userName == "王娅丽")
            {
                where = " and  zf1='销售内勤' ";
            }
            else if (userName == "邵凯丽")
            {
            }
            else
            {
                return(null);
            }
            sql = "select top " + pageSize.ToString() + " o.* from (  " +
                  "  select row_number() over(order by id desc) as rownumber,a.* from(  " +
                  "  select * from L_PushPoi where 1=1 and  OPERATE_TYPE='已提交' " + where + ") as a ) as o where rownumber> " + num.ToString();

            DataTable      dt     = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);
            List <PushPoi> result = new List <PushPoi>();

            foreach (DataRow row in dt.Rows)
            {
                PushPoi p = new PushPoi();
                p.ID           = row["ID"].ToString();
                p.BILLMAN      = row["BILLMAN"].ToString();
                p.OPERATE_TIME = row["OPERATE_TIME"].ToString();
                p.OPERATE_TYPE = row["OPERATE_TYPE"].ToString();
                p.CLIENT       = row["CLIENT"].ToString();
                p.BEFORE_LNG   = row["BEFORE_LNG"].ToString(); //原始定位
                p.BEFORE_LAT   = row["BEFORE_LAT"].ToString();
                p.AFTER_LNG    = row["AFTER_LNG"].ToString();  //经度//现在请求定位
                p.AFTER_LAT    = row["AFTER_LAT"].ToString();  //纬度
                double dis = ScueFun.LngLatDis.GetDistance(Convert.ToDouble(row["BEFORE_LNG"].ToString()),
                                                           Convert.ToDouble(row["BEFORE_LAT"].ToString()),
                                                           Convert.ToDouble(row["AFTER_LNG"].ToString()),
                                                           Convert.ToDouble(row["AFTER_LAT"].ToString()));
                p.DISTANCE = Math.Round(dis / 1000, 2).ToString() + "km";
                result.Add(p);
            }
            return(result);
        }
Exemplo n.º 15
0
        public kfContact GetContact(string client)
        {
            kfContact      contact = new kfContact();
            List <Contact> result  = new List <Contact>();
            string         cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string         session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);
            }
            MLogin.GetExeUname();
            string kf_code   = string.Empty;
            string tablename = string.Empty;

            #region
            //string kf_tb = string.Empty;
            //kfku m = new kfku();
            //List<kfku> ms = m.Select(" and NAME='" + client + "'  order by id desc  ");
            //if (ms.Count > 0)
            //{
            //    kf_code = ms[0].CODE;
            //    //kf_tb = "kfku";
            //    tablename = "kfku_contacter";
            //}
            //else
            //{
            #endregion
            ClientService_kfku        k  = new ClientService_kfku();
            List <ClientService_kfku> ks = k.Select(" and NAME='" + client + "'   order by id desc   ");
            if (ks.Count > 0)
            {
                kf_code   = ks[0].CODE;
                tablename = "clientservice_kfku_contacter";
            }
            if (kf_code == "" || tablename == "")//
            {
                return(null);
            }
            else
            {
                string    sql = " select * from  " + tablename + "  where 单位代码=" + kf_code.ToString();
                DataTable dt  = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);
                foreach (DataRow row in dt.Rows)
                {
                    Contact con = new Contact();
                    con.id       = row["ID"].ToString();
                    con.name     = row["姓名"].ToString();
                    con.phone    = row["手机"].ToString();
                    con.position = row["职务"].ToString();
                    result.Add(con);
                }
                contact.list      = result;
                contact.tablename = tablename;
                contact.kfcode    = kf_code;
            }
            return(contact);
        }
Exemplo n.º 16
0
        public string WeixiuForm(string userId)
        {
            MLogin.GetExeUname();
            WeiXiuBill weiXiu = new WeiXiuBill();

            weiXiu.姓名 = "text";
            weiXiu.日期 = "text";
            return(ScueFun.InnerHtml.SetForm <WeiXiuBill>(weiXiu));
        }
Exemplo n.º 17
0
        public List <WXOBJ1> AfterSRepair_P(string userName, int type, int curPage, int pageSize)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            int num = curPage * pageSize;

            string where = " and  BILLMAN='" + userName + "'  and  zf3 <> ''   and left(code,1) <> '*' ";
            if (type == 0)
            {
                where += " and  ((zf2=''  and  sz10=0 ) or (zf2<>'" + userName + "')) ";//未接收
            }
            else if (type == 1)
            {
                where += " and  zf2='" + userName + "'   and   id  in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id)  and OPERATE_TYPE = '接受' and BILLMAN ='" + userName + "' ) ";//处理中
            }
            else if (type == 2)
            {
                where += " and  zf2='" + userName + "'   and   id  in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id)  and OPERATE_TYPE = '完结' and BILLMAN ='" + userName + "' )  ";//维修完成
            }
            else
            {
            }
            List <WXOBJ1> ms = new List <WXOBJ1>();

            string sql = " select top " + pageSize.ToString() + " o.* from (  " +
                         " select row_number() over(order by id desc) as rownumber, N_A.* from( " +
                         " select * from clientservice_AfterServiceBill " +
                         " where 1 = 1 " + where +
                         " ) as N_A) as o where rownumber> " + num.ToString();

            DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            foreach (DataRow row in dt.Rows)
            {
                WXOBJ1 o = new WXOBJ1();
                o.ID       = Convert.ToInt32(row["ID"].ToString());
                o.CODE     = row["CODE"].ToString();//维修单号
                o.BILLMAN  = row["BILLMAN"].ToString();
                o.CLIENT   = row["CLIENT"].ToString();
                o.BILLTYPE = row["BILLTYPE"].ToString();
                o.ZF1      = row["ZF1"].ToString();     //机床编号
                o.NOTEPRE  = row["NOTEPRE"].ToString(); //内容描述(电话回访)
                o.ZF3      = row["ZF3"].ToString();     //分析描述 初判断
                o.CONTACT  = row["ZF27"].ToString();
                o.PHONE    = row["ZF28"].ToString();
                o.ZF5      = row["ZF5"].ToString();
                ms.Add(o);
            }
            return(ms);
        }
Exemplo n.º 18
0
        public List <FeeBill> MyFeeBills(string userName, int curPage, int pageSize)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();

            // P_MyBill result = new P_MyBill();
            int num = curPage * pageSize;
            // curPage++;
            string sql = " select top 10 o.* from( " +
                         " select row_number() over(order by id desc) as rownumber, a.* from( " +
                         " select * from TreatFee where BILLMAN = '" + userName + "' ) as a) as o where rownumber > " + num.ToString();
            DataTable dt = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            List <FeeBill> bills = new List <FeeBill>();

            foreach (DataRow row in dt.Rows)
            {
                FeeBill bill = new FeeBill();
                bill.billcode   = row["BILLCODE"].ToString();
                bill.billman    = row["BILLMAN"].ToString();
                bill.createtime = row["CREATETIME"].ToString();
                bill.state      = Convert.ToInt16(row["STATE"].ToString());
                if (bill.state == 0)
                {
                    bill.state_desc = "未审核";
                }
                else if (bill.state == 10)
                {
                    bill.state_desc = "审核通过";
                }
                else if (bill.state == -1)
                {
                    bill.state_desc = "审核失败";
                }
                bill.vbcode     = row["VBCODE"].ToString();
                bill.client     = row["CLIENT"].ToString();
                bill.eating     = row["EATING"].ToString();
                bill.other      = row["OTHER"].ToString();
                bill.person     = row["PERSON"].ToString();
                bill.traffic    = row["TRAFFIC"].ToString();
                bill.commission = row["COMMISSION"].ToString();
                bill.remark     = row["BLANK_STR_1"].ToString();
                bill.opinion    = row["BLANK_STR_2"].ToString();
                bills.Add(bill);
            }
            // result.list = bills;
            // result.page = curPage;
            return(bills);
        }
Exemplo n.º 19
0
        public User WS3_P(string userId, string password, string uuid)
        {
            //----------------------
            //lxdlxd
            MLogin.GetExeUname();
            User             NowUser = new User();
            List <puku_user> mp      = GetPUser.PUser(" and USERPU='" + userId.Trim() + "' ");

            if (mp.Count > 0)
            {
                if (BitLock.RealseLock_L(mp[0].MM) == password && uuid == mp[0].UUID)
                {
                    string my = string.Empty;
                    HttpContext.Current.Session["user"] = userId;
                    // my = "没有cookies";
                    my = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
                    if (my != "")
                    {
                        string cookies = HttpContext.Current.Request.Cookies["guid"].Value as string;
                        string session = Session.SessionID.ToString();
                        if (!session.Equals(cookies))//有cookies 但是已过期
                        {
                            HttpCookie objCookie = new HttpCookie("guid", Session.SessionID.ToString());
                            objCookie.Expires = DateTime.MaxValue;
                            System.Web.HttpContext.Current.Response.Cookies.Add(objCookie);
                        }
                        my = System.Web.HttpContext.Current.Request.Cookies["guid"].Value;
                    }
                    else//没有cookies 增加cookies
                    {
                        HttpCookie objCookie = new HttpCookie("guid", Session.SessionID.ToString());
                        objCookie.Expires = DateTime.MaxValue;
                        System.Web.HttpContext.Current.Response.Cookies.Add(objCookie);
                    }
                    NowUser.userId = userId;

                    NowUser.name       = mp[0].TURENAME;
                    NowUser.dept       = mp[0].DEPT;
                    NowUser.authorised = mp[0].允许管理物料BY仓库名称;
                    NowUser.status     = 10;
                    return(NowUser);
                    //var headers = Context.Request.Headers.GetValues("My-Header");
                }
                else
                {
                    NowUser.status = -1;
                    return(NowUser);
                }
            }
            else
            {
                NowUser.status = -1;
                return(NowUser);
            }
        }
Exemplo n.º 20
0
        public List <string> SignNote(string userId, string date)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            return(SignCS.SignRemark(userId, date));
        }
Exemplo n.º 21
0
        public List <PU> PUKU_U(string userName)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            return(UserLocation.GetPU(" and  userpu <> 'admin' "));
        }
Exemplo n.º 22
0
        //int client_id,
        public string GetKFLoc(string client)
        {
            //获取客户位置
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return("NoCookies");
            }
            MLogin.GetExeUname();
            return(KFLocation.Get(client));
        }
Exemplo n.º 23
0
        public List <LLBill> GetDBBill(string client, string userName, string dept)//获取待办事项
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            List <LLBill> result = new List <LLBill>();

            string where = "";
            if (dept.Contains("维修"))
            {
                where = " and (depar = '" + userName + "'  or  depar = '维修部' or depar = '智能化' )";
            }
            if (dept.Contains("业务") || dept.Contains("销售") || dept.Contains("文员"))
            {
                where = " and (depar = '" + userName + "'  or  depar = '销售部' or depar = '智能化' )";
            }
            string sql = " select top 15 * from " +
                         "   (select * from L_ContactSheet as aa " +
                         "   left join " +
                         "   (select name, ZF29, ZF30,CONTACTOR,PHONE from clientservice_kfku ) as bb on aa.Client = bb.NAME " +
                         "   ) as cc" +
                         "   where  type=0  and del =0  and  Client='" + client + "' " + where + "  order by finshdate   ";
            DataTable tb = DBLL.ExecuteDataTable(MyGlobal.DataBase, sql);

            foreach (DataRow row in tb.Rows)
            {
                LLBill n = new LLBill();
                n.id        = row["ID"].ToString();                                                   //客户
                n.client    = row["CLIENT"].ToString();                                               //客户
                n.code      = row["CODE"].ToString();                                                 //单号
                n.depar     = row["DEPAR"].ToString();                                                //部门
                n.finshdate = Convert.ToDateTime(row["FINSHDATE"].ToString()).ToString("yyyy-MM-dd"); //要求完成时间
                n.id        = row["ID"].ToString();
                n.inserter  = row["INSERTER"].ToString();                                             //提出人
                n.machinecn = row["MACHINECN"].ToString();                                            //机床编号
                n.mtitle    = row["MTITLE"].ToString();                                               //内容
                n.type      = row["TYPE"].ToString();                                                 //状态
                //n.distance = row["DISTANCE"].ToString()+"km"; //距离
                n.contactor = row["CONTACTOR"].ToString();                                            //联系人
                n.phone     = row["PHONE"].ToString();                                                //电话
                n.lng       = row["ZF29"].ToString();                                                 //经度
                n.lat       = row["ZF30"].ToString();                                                 //纬度
                result.Add(n);
            }
            return(result);
        }
Exemplo n.º 24
0
        public List <WXOBJ1> AfterSRepair(string userName, int type)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            string where = " and  BILLMAN='" + userName + "'  and  zf3 <> ''   and left(code,1) <> '*' ";
            string by = " top 20 * ";

            if (type == 0)
            {
                where += " and  ((zf2=''  and  sz10=0 ) or (zf2<>'" + userName + "'))  order by id desc  ";//未接收
            }
            else if (type == 1)
            {
                where += " and  zf2='" + userName + "'   and   id  in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id)  and OPERATE_TYPE = '接受' and BILLMAN ='" + userName + "' ) order by id desc";//处理中
            }
            else if (type == 2)
            {
                where += " and  zf2='" + userName + "'   and   id  in( select zf1 from L_AfterRepair a where not exists(select 1 from L_AfterRepair b where b.refercode = a.refercode and b.id > a.id)  and OPERATE_TYPE = '完结' and BILLMAN ='" + userName + "' )  order by id desc";//维修完成
            }
            else
            {
            }
            List <WXOBJ1> ms = new List <WXOBJ1>();
            clientservice_AfterServiceBill        bill = new clientservice_AfterServiceBill();
            List <clientservice_AfterServiceBill> list = bill.Select(where, by);

            foreach (clientservice_AfterServiceBill c in list)
            {
                WXOBJ1 o = new WXOBJ1();
                o.ID       = c.ID;
                o.CODE     = c.CODE;//维修单号
                o.BILLMAN  = c.BILLMAN;
                o.CLIENT   = c.CLIENT;
                o.BILLTYPE = c.BILLTYPE;
                o.ZF1      = c.ZF1;     //机床编号
                o.NOTEPRE  = c.NOTEPRE; //内容描述(电话回访)
                o.ZF3      = c.ZF3;     //分析描述 初判断
                o.CONTACT  = c.ZF27;
                o.PHONE    = c.ZF28;
                o.ZF5      = c.ZF5;
                ms.Add(o);
            }
            return(ms);
        }
Exemplo n.º 25
0
        public FindLoc GetPep(string name, string type)//修改为name   20180728 skl
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            string  position = "";
            string  lng; //经度
            string  lat; //纬度
            string  datetime = SysTime.GetTime.ToString("yyyyMMdd");
            FindLoc findLoc  = new FindLoc();

            findLoc.status = 0;//标记状态 0:未获取到客户位置  10:获取到客户位置
            List <PersonLOC> locs = new List <PersonLOC>();

            if (KFLocation.Get(name) != "")
            {
                findLoc.status = 10;
                position       = KFLocation.Get(name);
                string[] strs_kf = position.Split(',');
                lng = strs_kf[0];
                lat = strs_kf[1];
                //只取当天人的最新记录
                string           sql    = "select * from scue_user a where not exists(select 1 from scue_user b where b.userpu=a.userpu and b.id>a.id) and a.date ='" + datetime + "' ";
                List <scue_user> scue_s = BLL.SqlToList <scue_user>(MyGlobal.DataBase, sql);

                foreach (scue_user s in scue_s)
                {
                    string[]  strs   = s.POINTS.Split(',');
                    int       count  = strs.Length - 2;
                    string    newpoi = strs[count];
                    string[]  poi    = newpoi.Split(':');
                    PersonLOC o      = new PersonLOC();
                    o.userId   = s.USERPU;
                    o.userName = s.TURENAME;
                    o.lng      = Convert.ToDouble(poi[0]);
                    o.lat      = Convert.ToDouble(poi[1]);
                    o.lastTime = s.OPERATETIME.ToString();
                    locs.Add(o);
                }
                findLoc.kflng = Convert.ToDouble(lng);
                findLoc.kflat = Convert.ToDouble(lat);
                findLoc.list  = locs;
            }
            return(findLoc);
        }
Exemplo n.º 26
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     //--马克岚岚----
     //--数据植入代码----
     string[] Getinfo = MLogin.GetExeUname();
     if (Getinfo[1] == "null")
     {
         Msg Err = new Msg(3, "请勿非法启动源程序!\r\n若有疑问,请联系系统管理员", "非法启动", 1);
     }
     else
     {
         Application.Run(new MRoot());
     }
 }
Exemplo n.º 27
0
        public List <FeeBill> FeeBills(string userName)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            List <FeeBill>  bills = new List <FeeBill>();
            TreatFee        t     = new TreatFee();
            List <TreatFee> list  = t.Select(" and BILLMAN='" + userName + "' order by id desc ");

            foreach (TreatFee tf in list)
            {
                FeeBill bill = new FeeBill();
                bill.billcode   = tf.BILLCODE;
                bill.billman    = tf.BILLMAN;
                bill.createtime = tf.CREATETIME;
                bill.state      = tf.STATE;
                if (bill.state == 0)
                {
                    bill.state_desc = "未审核";
                }
                else if (bill.state == 10)
                {
                    bill.state_desc = "审核通过";
                }
                else if (bill.state == -1)
                {
                    bill.state_desc = "审核失败";
                }
                bill.vbcode     = tf.VBCODE;
                bill.client     = tf.CLIENT;
                bill.eating     = tf.EATING;
                bill.other      = tf.OTHER;
                bill.person     = tf.PERSON;
                bill.traffic    = tf.TRAFFIC;
                bill.commission = tf.COMMISSION;
                bill.remark     = tf.BLANK_STR_1;
                bill.opinion    = tf.BLANK_STR_2;
                bills.Add(bill);
            }
            return(bills);
        }
Exemplo n.º 28
0
        public void PushPoi(string userId, string name, string position)//修改为name  20180728 skl
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return;//身份验证失败
            }
            MLogin.GetExeUname();
            List <puku_user> now = ScueFun.GetPUser.PUser(" and USERPU='" + userId + "' ");

            if (now.Count > 0)
            {
                KFLocation.Set(now[0].TURENAME, name, position);
            }
        }
Exemplo n.º 29
0
        public List <VSBill> YWBillGet(string userName, string where)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            MLogin.GetExeUname();
            L_VisitSend   s          = new L_VisitSend();
            List <VSBill> returnlist = new List <VSBill>();
            string        today_1    = System.DateTime.Now.ToString("yyyy-MM-dd 00:00:00");
            string        today      = System.DateTime.Now.ToString("yyyy-MM-dd 23:59:59");
            //未接收消息
            List <L_VisitSend> list = s.Select(" and SENDUSER='******'  and  LEFT(CODE,1)<>'*'   and  VISITDATE < '" + today + "'  " + where, " top 20 * ");

            if (list.Count <= 0)
            {
                return(null);//没有消息
            }
            else
            {
                foreach (L_VisitSend l in list)
                {
                    VSBill vs = new VSBill();
                    vs.id        = l.ID;
                    vs.client    = l.VISITCLIENT;
                    vs.hisname   = l.VISITNAME;
                    vs.hisphone  = l.VISITTEL;
                    vs.content   = l.VISITCONTENT;
                    vs.notice    = l.DOTHING;
                    vs.visittype = l.VISITTYPE;
                    vs.date      = l.VISITDATE.ToShortDateString();
                    vs.code      = l.CODE;
                    vs.state     = l.STATE;
                    vs.rq1       = l.RQ1.ToString();
                    vs.rq2       = l.RQ2.ToString();
                    vs.zf5       = l.ZF5;
                    returnlist.Add(vs);
                }
            }
            return(returnlist);
        }
Exemplo n.º 30
0
        public List <Point> ReadPoints(string findId, string userName, string date, string start, string end)
        {
            string cookies = HttpContext.Current.Request.Cookies["guid"] == null ? "" : HttpContext.Current.Request.Cookies["guid"].Value as string;
            string session = Session.SessionID.ToString();

            if (!cookies.Equals(session))
            {
                return(null);//身份验证失败
            }
            //List<Point>
            MLogin.GetExeUname();
            string           str_date = System.Text.RegularExpressions.Regex.Replace(date, "-", "");
            scue_user        u        = new scue_user();
            List <scue_user> list     = u.Select(" and USERPU='" + findId + "' and code between '" + start + "' and  '" + end + "' and date='" + str_date + "'   order by id ");
            List <Point>     points   = new List <Point>();

            if (list.Count > 0)
            {
                foreach (scue_user user in list)
                {
                    string   str  = user.POINTS;
                    string[] strs = str.Split(',');
                    for (int i = 0; i < strs.Length - 1; i++)
                    {
                        string[] p     = strs[i].Split(':');
                        string   strx  = p[0];
                        string   stry  = p[1];
                        Point    point = new Point
                        {
                            lng  = Convert.ToDouble(strx),
                            lat  = Convert.ToDouble(stry),
                            time = p[2] + ":" + p[3] + ":" + p[4]
                        };
                        points.Add(point);
                    }
                }
                return(points);
            }
            else
            {
                return(null);
            }
            // return points;
        }