Пример #1
0
        /// <summary>
        /// 打卡上报
        /// </summary>
        /// <param name="PersonID"></param>
        /// <param name="checkDate"></param>
        /// <param name="checkTip"></param>
        public void UpCheck(string PersonID, string checkDate, string checkTip, string RowID)
        {
            View_A02 item       = new View_A02BLL().Select(o => o.RowID == RowID).FirstOrDefault();
            string   UnitID     = item.UnitID;
            B01      Unit       = new B01BLL().Select(o => o.UnitID == UnitID).FirstOrDefault();
            string   realUnitID = string.IsNullOrEmpty(Unit.upLoadId) ? Unit.UnitID : Unit.UnitID;
            string   param      = "<?xml version=\"1.0\" encoding=\"GBK\"?><p>";

            param += "<d k=\"vds\">";
            param += " <r ";
            param += " kqid=\"" + RowID + "\"";
            param += " ryid=\"" + item.PersonID + "\"";
            param += " xxly=\"" + xxly + "\"";
            param += " xmbh=\"" + realUnitID + "\"";
            param += " sfzh=\"" + item.A0177 + "\"";
            param += " xm=\"" + item.A0101 + "\"";
            param += " kqsj=\"" + HCQ2_Common.DateHelper.GetCSTDate(checkDate) + "\"";
            param += " sbbs=\"" + (item.A0203 == "1" ? 1 : 2) + "\"";
            param += " kqtz=\"9\"";
            param += " kqsbbm=\"\"";
            param += " />";
            param += "</d>";
            param += "</p>";

            WebUpData.uddi client2 = new WebUpData.uddi();
            ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
            client2.Url = "https://222.85.128.67:8088/dwlesbserver/services/uddi?wsdl";
            X509Certificate xs = new X509Certificate("E:\\RSA2008root.cer");

            client2.ClientCertificates.Add(xs);

            //基本信息上报字符串
            string serviceName = "HSMWService";
            string methodName  = "UploadProAttendInfo";
            string mess        = client2.invokeService(serviceName, methodName, param);

            if (mess.Contains("调用服务成功"))
            {
                //修改记录状态
                A02 att = new A02();
                att.if_upattend = "1";
                string updateRowID = item.RowID;
                base.Modify(att, o => o.RowID == updateRowID, "if_upattend");
            }
        }
Пример #2
0
        /// <summary>
        /// 异常考勤上报
        /// </summary>
        /// <param name="strUnit">单位编号的字符串</param>
        /// <returns></returns>
        public string UpAttends(string strUnit)
        {
            string          rStr    = "ok,0";
            List <View_A02> attList = DBSession.IView_A02DAL.GetAttendsByUnit(strUnit);

            if (attList.Count() <= 0)
            {
                return(rStr);
            }

            string param = "<?xml version=\"1.0\" encoding=\"GBK\"?><p>";

            param += "<d k=\"vds\">";
            param += UploadAttends(attList);
            param += "</d>";
            param += "</p>";

            string serviceName = "HSMWService";
            string methodName  = "UploadProAttendInfo";

            //正式地址
            WebUpData.uddi client2 = new WebUpData.uddi();
            ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
            client2.Url = "https://222.85.128.67:8088/dwlesbserver/services/uddi?wsdl";
            X509Certificate xs = new X509Certificate("E:\\RSA2008root.cer");

            client2.ClientCertificates.Add(xs);

            string mess = client2.invokeService(serviceName, methodName, param);

            if (mess.Contains("服务调用成功!"))
            {
                rStr = "ok" + "," + attList.Count();
            }
            else
            {
                rStr = "fin" + ",0";
            }
            return(rStr);
        }
Пример #3
0
        /// <summary>
        /// 上报异常考勤
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public bool UpLoadExcptionAttend(object obj)
        {
            List <string>   strXmlList = new List <string>();
            FormCollection  param      = (FormCollection)obj;
            JArray          comJson    = JArray.Parse(param["rows"]);
            List <View_A02> viewList   = new List <View_A02>();

            StringBuilder sbSql = new StringBuilder();
            //收集上报的项目的ID
            string strRowID = "";

            foreach (JObject item in comJson)
            {
                View_A02 at = new View_A02();
                at.RowID = item["RowID"].ToString();
                viewList.Add(at);
                if (string.IsNullOrEmpty(strRowID))
                {
                    strRowID = "'" + item["RowID"].ToString() + "'";
                }
                else
                {
                    strRowID += ",'" + item["RowID"].ToString() + "'";
                }
            }
            //需要上报的数据
            List <View_A02> attList = DBSession.IView_A02DAL.GetAttendsByRowID(strRowID);

            string xmlParam = "<?xml version=\"1.0\" encoding=\"GBK\"?><p>";

            xmlParam += "<d k=\"vds\">";
            xmlParam += UploadAttends(attList);
            xmlParam += "</d>";
            xmlParam += "</p>";

            string serviceName = "HSMWService";
            string methodName  = "UploadProAttendInfo";

            //正式地址
            WebUpData.uddi client2 = new WebUpData.uddi();
            ServicePointManager.ServerCertificateValidationCallback = ValidateServerCertificate;
            client2.Url = "https://222.85.128.67:8088/dwlesbserver/services/uddi?wsdl";
            X509Certificate xs = new X509Certificate("E:\\RSA2008root.cer");

            client2.ClientCertificates.Add(xs);

            string mess = client2.invokeService(serviceName, methodName, xmlParam);

            if (mess.Contains("服务调用成功"))
            {
                foreach (var item in viewList)
                {
                    string upRowID = item.RowID;
                    A02    view    = new A02();
                    view.if_upattend = "1";
                    new A02BLL().Modify(view, o => o.RowID == upRowID, "if_upattend");
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }