Beispiel #1
0
        public int RepairDeal(string userName, string type, int id, string refercode)
        {
            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();
            //事务处理开始,劫持链接通道的sql语句
            TransactionSql.Start(MyGlobal.DataBase);  //===>开始

            L_AfterRepair repair = new L_AfterRepair();

            repair.BILLMAN      = userName;
            repair.OPERATE_TIME = SysTime.GetTime.ToString();
            repair.REFERCODE    = refercode;     //关联维修单号
            repair.OPERATE_TYPE = type;
            repair.ZF1          = id.ToString(); //关联维修单号的id
            repair.Insert();
            if (type == "接受")
            {
                BLL.SetToSql(MyGlobal.DataBase, " update clientservice_AfterServiceBill set zf2 = '" + userName + "' where id = " + id);
            }
            else if (type == "拒绝")
            {
                BLL.SetToSql(MyGlobal.DataBase, " update clientservice_AfterServiceBill set BillMan = '', auditing = '' where id = " + id);
            }
            else
            {
            }

            //提交事务到sql服务器处理
            if (!TransactionSql.EndSql())                     //===>结束
            {
                flag = -1;
            }
            return(flag);
        }
Beispiel #2
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);
        }