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());
        }
        public List <Kfkf> Neighbour(string type, double lng, double lat, 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();
            puku_user        p    = new puku_user();
            List <puku_user> list = GetPUser.PUser(" and TURENAME='" + userName + "'  ");
            string           dept = "";

            if (list.Count <= 0)
            {
                dept = "业务员";
            }
            else
            {
                dept = list[0].DEPT;
            }
            DataTable   dt = Function.NeighbourPosition(dept, lng, lat, type, userName);
            List <Kfkf> ks = new List <Kfkf>();

            foreach (DataRow r in dt.Rows)
            {
                Kfkf k = new Kfkf();
                k.name      = r["NAME"].ToString();
                k.type      = r["TRADETYPENAME"].ToString();
                k.contactor = r["CONTACTOR"].ToString();
                k.phone     = r["PHONE"].ToString();
                k.lng       = Convert.ToDouble(r["ZF29"].ToString());
                k.lat       = Convert.ToDouble(r["ZF30"].ToString());
                k.lastVisit = r["INTRODUCERDATE"].ToString();
                k.billman   = r["BILLMAN"].ToString();
                k.remark    = r["NotePre"].ToString();
                ks.Add(k);
            }
            return(ks);
        }
Exemple #3
0
        public User WS2(string userId, string password, string uuid)
        {
            MLogin.GetExeUname();
            User u = new User();

            u.status = -1;
            u.userId = userId.Trim();
            puku_user        p  = new puku_user();
            List <puku_user> mp = p.Select(" and USERPU='" + userId.Trim() + "'  and isstop <> '是' ");

            if (mp.Count > 0)
            {
                if (BitLock.RealseLock_L(mp[0].MM) == password)
                {
                    string sql_uuid = mp[0].UUID == null? "":mp[0].UUID;
                    if (uuid != "web" && sql_uuid == "")
                    {
                        puku_user _User = new puku_user();
                        _User.UUID = uuid;
                        _User.Updata(" and USERPU='" + userId.Trim() + "' and isstop <> '是' and (uuid is null or uuid ='' )");
                    }
                    //UserInfo.UName = mp[0].TURENAME;
                    UserInfo.Uzw = "管理员";
                    u.name       = mp[0].TURENAME;
                    u.dept       = mp[0].DEPT;
                    u.authorised = mp[0].允许管理物料BY仓库名称;
                    u.status     = 10;
                    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 (System.Web.HttpContext.Current.Request.Cookies["guid"] != null && System.Web.HttpContext.Current.Request.Cookies["guid"].ToString().Trim() != "")
                    {
                        string cookies = HttpContext.Current.Request.Cookies["guid"].Value as string;
                        string session = Session.SessionID.ToString();
                        if (!session.Equals(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
                    {
                        HttpCookie objCookie = new HttpCookie("guid", Session.SessionID.ToString());
                        objCookie.Expires = DateTime.MaxValue;
                        System.Web.HttpContext.Current.Response.Cookies.Add(objCookie);
                    }

                    u.session = Session.SessionID.ToString();
                    u.cookies = my;
                    //var headers = Context.Request.Headers.GetValues("My-Header");
                }
                else
                {
                    u.status = 5;//密码错误
                }
            }
            else
            {
                u.status = 0;//不存在该用户
            }
            return(u);
        }
Exemple #4
0
        public int WxReport(string userName, double lng1, double lat1, string userId, string client, string billcode, int id, string note)
        {
            int    flag    = 0;
            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();
            string position = KFLocation.Get(client);
            double lng, lat;

            if (MyGlobal.AERA_CHECK) //是否范围校验
            {
                if (position == "")  //该客户没有定位,将现在这个位置赋值给当前客户
                {
                    flag = -2;
                    return(flag);
                }
                else if (position == "none")//不存在该用户
                {
                    flag = -3;
                    return(flag);
                }
                else
                {
                }
                string[] strs = position.Split(',');
                lng = Convert.ToDouble(strs[0]);
                lat = Convert.ToDouble(strs[1]);

                if (ScueFun.LngLatDis.GetDistance(lng, lat, lng1, lat1) > MyGlobal.VISITAERA)
                {
                    flag = 5;
                    return(flag);//超出范围不能提交
                }
            }
            else
            {
                lng = lng1;
                lat = lat1;
            }

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

            clientservice_AfterServiceBill C = new clientservice_AfterServiceBill();

            C.ZF5 = note;
            string[] strs_p = Function.StayTime(userId, lng1, lat1, client);
            if (strs_p != null)
            {
                C.ZF11 = strs_p[0] == null ? "" : strs_p[0]; //开始时间
                C.ZF12 = strs_p[1] == null ? "" : strs_p[1]; //结束时间
                C.ZF13 = strs_p[2] == null ? "" : strs_p[2]; //时间间隔
            }
            C.Updata(" AND ID=" + id);
            L_AfterRepair repair = new L_AfterRepair();

            repair.BILLMAN      = userName;
            repair.OPERATE_TIME = now.ToString();
            repair.REFERCODE    = billcode;      //关联维修单号
            repair.OPERATE_TYPE = "完结";
            repair.ZF1          = id.ToString(); //关联维修单号的id
            repair.Insert();

            //更新关联单据号,最新的,可作为最后打卡的目标公司,名称、地址  20180904 skl
            puku_user u = new puku_user();

            u.REFERCODE = billcode;
            u.ZF1       = client;
            u.ZF2       = lng.ToString();
            u.ZF3       = lat.ToString();
            u.ZF4       = now.ToString("yyyy-MM-dd HH:mm:ss");
            u.Updata(" and  USERPU='" + userId + "'   ");

            //提交事务到sql服务器处理//===>结束
            if (!TransactionSql.EndSql())//判断是否成功
            {
                flag = -1;
            }
            return(flag);
        }
Exemple #5
0
        private void RegistBS(string password, string user, string type)
        {
            string user_mm   = ScueFun.BitLock.GetLock_L(password);
            string str_idept = "";
            string dept      = "";

            foreach (Control ctrl in this.Controls)
            {
                if (ctrl is CheckBox && ((CheckBox)ctrl).Checked)
                {
                    dept = ctrl.Text;
                    if (ctrl.Text == "维修员")
                    {
                        str_idept += "SW0002,FJ0001,";
                    }
                    else if (ctrl.Text == "业务员")
                    {
                        str_idept += "SW0001,SW0002,FJ0001,FJ0002,FJ0003,FJ0004,";
                    }
                    else if (ctrl.Text == "销售内勤")
                    {
                        str_idept += "SW0001,SW0002,FJ0001,FJ0002,FJ0003,FJ0004,AD0003,";
                    }
                    else if (ctrl.Text == "业务经理")
                    {
                        str_idept += "AD0001,AD0002,AD0003,FJ0003";
                    }
                    else if (ctrl.Text == "维修经理")
                    {
                        str_idept += "AD0001,AD0002,AD0003,FJ0003";
                    }
                    else if (ctrl.Text == "总经理")
                    {
                        str_idept += "SW0001,SW0002,FJ0001,FJ0002,FJ0003,FJ0004,AD0001,AD0002,AD0003,";
                    }
                    else if (ctrl.Text == "后台")
                    {
                        str_idept += "SW0001,SW0002,FJ0001,FJ0002,FJ0003,FJ0004,AD0001,AD0002,AD0003,";
                    }
                    else
                    {
                    }
                    ((CheckBox)ctrl).Checked = false;
                }
            }
            if (str_idept.Length > 0)
            {
                str_idept = str_idept.Substring(0, str_idept.Length - 1);//去掉最后一个","
            }
            //---------------------
            // string Mcode = (string)Ifun.IsDBnull(Bform._mTable.SelectedRows[0].Cells["code"].Value.ToString(), "");
            // puku tb_user = new puku();
            //List<puku> lis = tb_user.Select("and code='" + Mcode + "'");
            // puku p = new puku();
            // p.CODE = Bform._mTable.SelectedRows[0].Cells["code"].Value.ToString();
            // p.Insert();
            //-------------------
            if (type.ToUpper().Trim() == "REGIST")
            {
                List <puku> list_puku = MUser.Get用户(" and USERPU='" + user + "'  ");
                //PUKU.Select("and USERPU='" + user + "' and ISSTOP <> '是' ");
                puku_user User = new puku_user();
                User              = ScueFun.ScueMerge.MergeFrom(User, list_puku[0]);
                User.MM           = user_mm;
                User.DEPT         = dept;
                User.允许管理物料BY仓库名称 = str_idept;
                User.Insert();
                Msg msg = new Msg(3, "注册成功!");
            }
            else if (type.ToUpper().Trim() == "MODIFY")
            {
                List <puku_user> list_user = GetPUser.PUser(" and USERPU='" + user + "' ");
                //USER.Select("and USERPU='" + user + "'  and ISSTOP <> '是' ");
                puku_user UU = new puku_user();
                UU.MM           = user_mm;
                UU.允许管理物料BY仓库名称 = str_idept;
                UU.Updata(" and id =" + list_user[0].ID);
                Msg msg = new Msg(3, "修改成功!");
            }
            else if (type.ToUpper().Trim() == "CANCLE")
            {
                List <puku_user> list_user = GetPUser.PUser(" and USERPU='" + user + "' ");

                puku_user m_user = list_user[0];
                m_user.Reset_puku_user();
                m_user.ISSTOP = "是";
                m_user.Updata(" and id =" + list_user[0].ID);
                //  m_user.ScueUpdate(ScueMerge.GetProperties(m_user), " and id =" + list_user[0].ID);
                Msg msg = new Msg(3, "取消注册成功!");
            }
            else
            {
                List <puku> list_puku = MUser.Get用户(" and USERPU='" + user + "'  ");
                puku_user   User      = new puku_user();
                User      = ScueFun.ScueMerge.MergeFrom(User, list_puku[0]);
                User.MM   = user_mm;
                User.DEPT = str_idept;
                User.Insert();
                Msg msg = new Msg(3, "注册成功!");
            }
            Bform._LeftPanel.Controls[0].Controls["password"].Text = "";
            Bform._LeftPanel.Controls[0].Controls["user"].Text     = "";
            Bform._LeftPanel.Controls[0].Controls["truename"].Text = "";
        }
Exemple #6
0
        /// <summary>
        /// 返回 -1:没有该人员  -2:没有任何单子  -3:距离超长  -4:已签到  -5;已签到下班  0:成功
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="lng"></param>
        /// <param name="lat"></param>
        /// <returns></returns>
        public static int SignOut(string userName, string userId, double lng, double lat)
        {
            puku_user        user  = new puku_user();
            List <puku_user> pukus = user.Select(" and USERPU='" + userId + "'  and ISSTOP='否'  and left(ZF4, 10)= CONVERT(varchar(10), GETDATE(), 120)  ");

            if (pukus.Count > 0)
            {
                //double lng_kf = pukus[0].ZF2 == null ? -1 : Convert.ToDouble(pukus[0].ZF2);
                //double lat_kf = pukus[0].ZF3 == null ? -1 : Convert.ToDouble(pukus[0].ZF3);
                //if (lng_kf == -1 || lat_kf == -1)
                //{
                //    return -2;//没有任何单子
                //}
                //else
                //{
                string date = System.DateTime.Now.ToString("yyyy-MM-dd");
                if (MyGlobal.AERA_CHECK)    //是否距离校验
                {
                    if (LngLatDis.GetDistance(lng, lat, Convert.ToDouble(pukus[0].ZF2), Convert.ToDouble(pukus[0].ZF3)) > MyGlobal.VISITAERA)
                    {
                        return(-3);   //距离超长
                    }
                }
                //else
                //{
                L_SIGN        s = new L_SIGN();
                List <L_SIGN> l = s.Select(" AND USERID='" + userId + "'  AND  DATE='" + date + "'  ");
                if (l.Count <= 0)    //今日无签到记录
                {
                    L_SIGN mm = new L_SIGN();
                    mm.USERID     = userId;
                    mm.TURENAME   = pukus[0].TURENAME;
                    mm.DATE       = date;
                    mm.TIME_D     = SysTime.GetTime.ToString("yyyy-MM-dd HH:mm:ss");
                    mm.NAME_D     = pukus[0].ZF1;
                    mm.LAT_D      = lat.ToString();     //签到时 用户的位置
                    mm.LNG_D      = lng.ToString();
                    mm.R_CODE_OUT = pukus[0].REFERCODE; //签到依据的单据
                    mm.Insert();
                    return(0);
                }
                else    //今日记录已存在
                {
                    string sign_out = l[0].TIME_D == null ? "" : l[0].TIME_D;
                    if (sign_out.Trim() != "") //下班已签到
                    {
                        return(-4);            //已签到
                    }
                    else
                    {
                        L_SIGN mm = new L_SIGN();
                        mm.TIME_D     = SysTime.GetTime.ToString("yyyy-MM-dd HH:mm:ss");
                        mm.NAME_D     = pukus[0].ZF1;
                        mm.LAT_D      = lat.ToString();
                        mm.LNG_D      = lng.ToString();
                        mm.R_CODE_OUT = pukus[0].REFERCODE;
                        mm.Updata(" and  id=" + l[0].ID);
                        return(0);
                    }
                }
                //}
            }
            else
            {
                return(-2);//没有该人员
            }
        }
Exemple #7
0
        public static List <puku_user> PUser(string str_where)
        {
            puku_user user = new puku_user();

            return(user.Select(str_where + " and ISSTOP <> '是' "));
        }
Exemple #8
0
        public static List <puku_user> PUser()
        {
            puku_user user = new puku_user();

            return(user.Select(" and ISSTOP <> '是' "));
        }
Exemple #9
0
        public int NewVisit(int bfid, string userId, string client, string zf2, string billtype, string date, string hisname,
                            string hisposition, string hisphone, string content, string userName, double lng1, double lat1,
                            string nextTime, string nextMethod, string nextNotice, string saleContent, string IfWX,
                            string list_id, string list_reply)
        {
            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();
            int flag = 0;//默认为0

            try
            {
                //事务处理开始,劫持链接通道的sql语句
                DateTime now = SysTime.GetTime;
                TransactionSql.Start(MyGlobal.DataBase);  //===>开始
                if (list_id.Trim() != "" && list_reply.Trim() != "")
                {
                    list_id    = list_id.Substring(0, list_id.Length - 1);
                    list_reply = list_reply.Substring(0, list_reply.Length - 1);
                    string[] ids     = list_id.Split(',');
                    string[] replies = list_reply.Split(',');
                    int      count;
                    for (count = 0; count < ids.Length; count++)
                    {
                        L_ContactSheetMsg msg = new L_ContactSheetMsg();
                        msg.MTITLE     = replies[count];
                        msg.INSERTER   = userName;
                        msg.FID        = Convert.ToInt32(ids[count]);
                        msg.INSERTDATE = now;
                        msg.STATE      = "已提交";
                        msg.Insert();
                    }
                }

                string position = KFLocation.Get(client);
                double lng, lat;
                if (MyGlobal.AERA_CHECK) //是否范围校验
                {
                    if (position == "")  //该客户没有定位,将现在这个位置赋值给当前客户
                    {
                        flag = -1;
                        return(flag);
                    }
                    else if (position == "none")//不存在该用户
                    {
                        flag = -2;
                        return(flag);
                    }
                    string[] strs_kf = position.Split(',');
                    lng = Convert.ToDouble(strs_kf[0]);
                    lat = Convert.ToDouble(strs_kf[1]);

                    #region 数据库获取定位
                    //string userpoi = UserLocation.Get(userId);
                    //
                    //if (userpoi == "")
                    //{
                    //    flag = -2;
                    //    return flag;//用户无定位信息
                    //}
                    //string[] poi = userpoi.Split(':');
                    //lng1 = Convert.ToDouble(poi[0]);
                    //lat1 = Convert.ToDouble(poi[1]);
                    #endregion

                    if (ScueFun.LngLatDis.GetDistance(lng, lat, lng1, lat1) > MyGlobal.VISITAERA)
                    {
                        flag = 5;
                        return(flag);//超出范围不能提交
                    }
                }
                else
                {
                    lng = lng1;
                    lat = lat1;
                }

                clientservice_VisitBill bill = new clientservice_VisitBill();
                //kfku m = new kfku();
                string lev = string.Empty;
                int    day = 0;
                //List<kfku> ms = m.Select(" and NAME='" + client + "'  order by id desc  ");
                //if (ms.Count > 0)
                //{
                //    if(ms[0].TRADETYPENAME!=null&& ms[0].LEV!=null)
                //    {
                //        bill.ZF1 = ms[0].TRADETYPENAME.ToString();
                //        lev = ms[0].LEV;
                //    }
                //}
                //else
                //{

                ClientService_kfku        k  = new ClientService_kfku();
                List <ClientService_kfku> ks = k.Select(" and NAME='" + client + "'   order by id desc   ");
                if (ks.Count > 0)
                {
                    if (ks[0].TRADETYPENAME != null && ks[0].LEV != null)
                    {
                        bill.ZF1 = ks[0].TRADETYPENAME.ToString();
                        lev      = ks[0].LEV;
                        if (ks[0].TRADETYPENAME == "新建客户" && ks[0].CONTACTOR == null && ks[0].PHONE == null && ks[0].ZF34 == "PHONE")
                        {
                            k.CONTACTOR = hisname;
                            k.PHONE     = hisphone;
                            k.ZF8       = hisposition;
                            k.Updata(" and id=" + ks[0].ID);
                        }
                    }
                }
                //}
                if (lev.Contains("1级"))
                {
                    day = 150;
                }
                else if (lev.Contains("2级"))
                {
                    day = 100;
                }
                else if (lev.Contains("3级"))
                {
                    day = 60;
                }
                else if (lev.Contains("4级"))
                {
                    day = 30;
                }
                else if (lev.Contains("5级"))
                {
                    day = 7;
                }
                else
                {
                    day = 0;
                }
                bill.CODE           = ScueFun.Code.BasicCode();
                bill.CLIENT         = client;
                bill.BILLDATE       = Convert.ToDateTime(date);
                bill.BILLMAN        = userName;
                bill.NOTEPRE        = content;
                bill.ZF2            = zf2;
                bill.BILLTYPE       = billtype;
                bill.INTRODUCERDATE = now;
                bill.FINISHDATE     = now;
                bill.ZF3            = hisname;//存放对方信息
                bill.ZF4            = hisposition;
                bill.ZF5            = hisphone;

                //增加天
                DateTime dt1 = now.AddDays(day);
                if (nextTime == "默认")
                {
                    bill.ZF6 = dt1.ToString("yyyy-MM-dd");
                }
                else
                {
                    bill.ZF6 = nextTime;
                }
                bill.ZF7  = IfWX;//是否有其他需求
                bill.ZF8  = nextNotice;
                bill.ZF9  = nextMethod;
                bill.ZF10 = saleContent;
                string[] strs = Function.StayTime(userId, lng1, lat1, client);
                if (strs != null)
                {
                    bill.ZF11 = strs[0] == null ? "" : strs[0]; //开始时间
                    bill.ZF12 = strs[1] == null ? "" : strs[1]; //结束时间
                    bill.ZF13 = strs[2] == null ? "" : strs[2]; //时间间隔
                }
                bill.INTRODUCER = userName;

                L_VisitSend s       = new L_VisitSend();
                string      today_1 = now.ToString("yyyy-MM-dd 00:00:00");
                string      today   = now.ToString("yyyy-MM-dd 23:59:59");
                string      refer   = string.Empty;
                if (bfid == -1) //若不是链接操作,主动查询,校验是否存在派单信息,取最早的
                {
                    List <L_VisitSend> sl = s.Select("  and VISITCLIENT='" + client + "'  and state = 7  and GETUSER='******'  order by id ");
                    if (sl.Count > 0)
                    {
                        bfid = sl[0].ID;
                    }
                }
                if (bfid != -1)
                {
                    List <L_VisitSend> list = s.Select("  and id= " + bfid + "  and state = 7 ");
                    foreach (L_VisitSend i in list)
                    {
                        L_VisitSend vs = new L_VisitSend();
                        vs.STATE = 10;
                        vs.RQ2   = now;//完成时间
                        if (IfWX.Contains("有业务需求"))
                        {
                            vs.ZF1 = "有意向";
                        }
                        vs.ZF5 = content;//拜访内容
                        vs.Updata(" and id=" + i.ID);
                        refer = i.CODE;
                    }
                }
                if (IfWX.Contains("有业务需求"))
                {
                    bill.ZF14 = "有意向";
                }
                ClientService_kfku km = new ClientService_kfku();
                km.ZF33 = bill.CODE;                                  //关联单据号
                km.RQ1  = Convert.ToDateTime(bill.ZF6 + " 00:00:00"); //string格式有要求,必须是yyyy-MM-dd hh: mm: ss
                km.Updata("  and NAME='" + client + "'  ");
                bill.REFERCODE = refer;
                bill.Insert();

                //更新关联单据号,最新的,可作为最后打卡的目标公司,名称、地址  20180904 skl
                puku_user u = new puku_user();
                u.REFERCODE = bill.CODE;
                u.ZF1       = client;
                u.ZF2       = lng.ToString();
                u.ZF3       = lat.ToString();
                u.ZF4       = now.ToString("yyyy-MM-dd HH:mm:ss");
                u.Updata(" and  USERPU='" + userId + "'   ");

                //提交事务到sql服务器处理
                if (!TransactionSql.EndSql())
                {
                    flag = -3; //回滚触发
                }              //===>结束
            }
            catch (Exception ex)
            {
                flag = -3;//回滚触发
            }
            finally
            {
            }
            return(flag);
        }