コード例 #1
0
 //Get the total number of orders for a specific customer
 public int SaveAuditDetail(AuditDetails auditdetail)
 {
     using (var database = new SQLiteConnection(_helper.WritableDatabase.Path))
     {
         return(database.Insert(auditdetail));
     }
 }
コード例 #2
0
ファイル: Contribution.cs プロジェクト: panky2sharma/OpenEHR
        public Contribution(HierObjectId uid, AuditDetails audit)
            : this(uid)
        {
            Check.Require(audit != null, "audit must not be null");

            this.audit = audit;
        }
コード例 #3
0
ファイル: VersionBase.cs プロジェクト: panky2sharma/OpenEHR
        protected virtual void ReadXmlBase(System.Xml.XmlReader reader)
        {
            Check.Assert(reader.LocalName == "contribution",
                         "Expected LocalName is 'contribution' rather than " + reader.LocalName);
            string contributionType = reader.GetAttribute("type", RmXmlSerializer.XsiNamespace);

            if (contributionType != null)
            {
                this.contribution = OpenEhr.RM.Support.Identification.ObjectRef.GetObjectRefByType(contributionType);
            }
            else
            {
                this.contribution = new ObjectRef();
            }
            this.contribution.ReadXml(reader);

            Check.Assert(reader.LocalName == "commit_audit",
                         "Expected LocalName is 'commit_audit' rather than " + reader.LocalName);
            this.commitAudit = new OpenEhr.RM.Common.Generic.AuditDetails();
            this.commitAudit.ReadXml(reader);

            if (reader.LocalName == "signature")
            {
                this.signature = reader.ReadElementString("signature", RmXmlSerializer.OpenEhrNamespace);
            }
            reader.MoveToContent();
        }
コード例 #4
0
ファイル: SQLAuditProvider.cs プロジェクト: vinay1988/Ang6API
        /// <summary>
        /// GetListForGoodsInLine
        /// Calls [usp_selectAll_Audit_for_GoodsInLine]
        /// </summary>
        public override List <AuditDetails> GetListForGoodsInLine(System.Int32?goodsInLineId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Audit_for_GoodsInLine", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@GoodsInLineId", SqlDbType.Int).Value = goodsInLineId;
                cn.Open();

                DbDataReader        reader = ExecuteReader(cmd);
                List <AuditDetails> lst    = new List <AuditDetails>();
                while (reader.Read())
                {
                    AuditDetails obj = new AuditDetails();
                    obj.AuditId        = GetReaderValue_Int32(reader, "AuditId", 0);
                    obj.TableName      = GetReaderValue_String(reader, "TableName", "");
                    obj.HeaderNo       = GetReaderValue_Int32(reader, "HeaderNo", 0);
                    obj.DetailLineNo   = GetReaderValue_NullableInt32(reader, "DetailLineNo", null);
                    obj.CompanyNo      = GetReaderValue_NullableInt32(reader, "CompanyNo", null);
                    obj.DateReceived   = GetReaderValue_NullableDateTime(reader, "DateReceived", null);
                    obj.DateOrdered    = GetReaderValue_NullableDateTime(reader, "DateOrdered", null);
                    obj.DateRequired   = GetReaderValue_NullableDateTime(reader, "DateRequired", null);
                    obj.DatePromised   = GetReaderValue_NullableDateTime(reader, "DatePromised", null);
                    obj.DeliveryDate   = GetReaderValue_NullableDateTime(reader, "DeliveryDate", null);
                    obj.DateDue        = GetReaderValue_NullableDateTime(reader, "DateDue", null);
                    obj.DateAuthorised = GetReaderValue_NullableDateTime(reader, "DateAuthorised", null);
                    obj.Quantity       = GetReaderValue_NullableInt32(reader, "Quantity", null);
                    obj.Price          = GetReaderValue_NullableDouble(reader, "Price", null);
                    obj.LandedCost     = GetReaderValue_NullableDouble(reader, "LandedCost", null);
                    obj.Freight        = GetReaderValue_NullableDouble(reader, "Freight", null);
                    obj.ShipCost       = GetReaderValue_NullableDouble(reader, "ShipCost", null);
                    obj.FullPart       = GetReaderValue_String(reader, "FullPart", "");
                    obj.ExternalPart   = GetReaderValue_String(reader, "ExternalPart", "");
                    obj.StockNo        = GetReaderValue_NullableInt32(reader, "StockNo", null);
                    obj.CurrencyNo     = GetReaderValue_NullableInt32(reader, "CurrencyNo", null);
                    obj.TermsNo        = GetReaderValue_NullableInt32(reader, "TermsNo", null);
                    obj.TaxNo          = GetReaderValue_NullableInt32(reader, "TaxNo", null);
                    obj.CreditLimit    = GetReaderValue_NullableDouble(reader, "CreditLimit", null);
                    obj.CreditLimitNew = GetReaderValue_NullableDouble(reader, "CreditLimitNew", null);
                    obj.Note           = GetReaderValue_String(reader, "Note", "");
                    obj.UpdatedBy      = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP           = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.EmployeeName   = GetReaderValue_String(reader, "EmployeeName", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to get Audits", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
コード例 #5
0
        private static Audit PopulateFromDBDetailsObject(AuditDetails obj)
        {
            Audit objNew = new Audit();

            objNew.AuditId        = obj.AuditId;
            objNew.TableName      = obj.TableName;
            objNew.HeaderNo       = obj.HeaderNo;
            objNew.DetailLineNo   = obj.DetailLineNo;
            objNew.CompanyNo      = obj.CompanyNo;
            objNew.DateReceived   = obj.DateReceived;
            objNew.DateOrdered    = obj.DateOrdered;
            objNew.DateRequired   = obj.DateRequired;
            objNew.DatePromised   = obj.DatePromised;
            objNew.DeliveryDate   = obj.DeliveryDate;
            objNew.DateDue        = obj.DateDue;
            objNew.DateAuthorised = obj.DateAuthorised;
            objNew.Quantity       = obj.Quantity;
            objNew.Price          = obj.Price;
            objNew.LandedCost     = obj.LandedCost;
            objNew.Freight        = obj.Freight;
            objNew.ShipCost       = obj.ShipCost;
            objNew.FullPart       = obj.FullPart;
            objNew.ExternalPart   = obj.ExternalPart;
            objNew.StockNo        = obj.StockNo;
            objNew.CurrencyNo     = obj.CurrencyNo;
            objNew.TermsNo        = obj.TermsNo;
            objNew.TaxNo          = obj.TaxNo;
            objNew.CreditLimit    = obj.CreditLimit;
            objNew.CreditLimitNew = obj.CreditLimitNew;
            objNew.Note           = obj.Note;
            objNew.UpdatedBy      = obj.UpdatedBy;
            objNew.DLUP           = obj.DLUP;
            objNew.EmployeeName   = obj.EmployeeName;
            return(objNew);
        }
コード例 #6
0
        public IActionResult CheckList(AuditDetails auditDetails)
        {
            try
            {
                var token = HttpContext.Request.Cookies["Token"]; //Get the value of Token from Cookie

                if (token == null)
                {
                    ViewBag.Message = "Session Expired !! Please Login ....";
                    return(View("Login"));
                }

                List <CheckListQuestion> questionList     = new List <CheckListQuestion>();
                CheckListService         checkListService = new CheckListService(_configuration);


                questionList = checkListService.GetQuestions(auditDetails.Type, token);

                return(View(questionList));
            }
            catch (Exception e)
            {
                return(View("Error"));
            }
        }
コード例 #7
0
        public async Task <Audit> PostAudit(AuditDetails item)
        {
            Audit audit = null;

            if (item == null)
            {
                throw new NullReferenceException();
            }
            else
            {
                audit = new Audit()
                {
                    Auditid                = item.Auditid,
                    ProjectName            = item.ProjectName,
                    ProjectManagerName     = item.ProjectManagerName,
                    ApplicationOwnerName   = item.ApplicationOwnerName,
                    AuditType              = item.AuditType,
                    AuditDate              = DateTime.Now,
                    ProjectExecutionStatus = item.ProjectExecutionStatus,
                    RemedialActionDuration = item.RemedialActionDuration,
                    Userid = item.Userid
                };
                await _context.Audit.AddAsync(audit);

                await _context.SaveChangesAsync();
            }
            return(audit);
        }
コード例 #8
0
ファイル: VersionBase.cs プロジェクト: panky2sharma/OpenEHR
        protected Version(AuditDetails commitAudit, ObjectRef contribution)
        {
            Check.Require(commitAudit != null, "commitAudit must not be null.");

            // set local data
            this.contribution = contribution;
            this.commitAudit  = commitAudit;
        }
コード例 #9
0
 //Get the total number of orders for a specific customer
 public int SaveAuditDetail(AuditDetails auditdetail)
 {
     using (var database = new SQLiteConnection(_helper.WritableDatabase.Path))
     {
         try
         {
             return(database.Insert(auditdetail));
         }
         catch (Exception ex)
         {
             throw;
         }
     }
 }
コード例 #10
0
ファイル: SQLAuditProvider.cs プロジェクト: vinay1988/Ang6API
        /// <summary>
        /// GetListInsuranceHistoryForCompany
        /// Calls [usp_selectAll_Insurance_History_for_Company]
        /// </summary>
        public override List <AuditDetails> GetListInsuranceHistoryForCompany(System.Int32?companyId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Insurance_History_for_Company", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@CompanyId", SqlDbType.Int).Value = companyId;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <AuditDetails> lst    = new List <AuditDetails>();
                while (reader.Read())
                {
                    AuditDetails obj = new AuditDetails();
                    obj.InsHistoryId       = GetReaderValue_Int32(reader, "InsHistoryId", 0);
                    obj.CompanyNo          = GetReaderValue_NullableInt32(reader, "CompanyNo", null);
                    obj.InsuredAmount      = GetReaderValue_NullableDouble(reader, "InsuredAmount", null);
                    obj.InsuredAmountNew   = GetReaderValue_NullableDouble(reader, "InsuredAmountNew", null);
                    obj.UpdatedBy          = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP               = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.EmployeeName       = GetReaderValue_String(reader, "EmployeeName", "");
                    obj.InsuranceFileNo    = GetReaderValue_String(reader, "InsuranceFileNo", "");
                    obj.InsuranceFileNoNew = GetReaderValue_String(reader, "InsuranceFileNoNew", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            }
            catch (SqlException sqlex)
            {
                //LogException(sqlex);
                throw new Exception("Failed to get Audits", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
コード例 #11
0
ファイル: SQLAuditProvider.cs プロジェクト: vinay1988/Ang6API
        /// <summary>
        /// Calls [usp_selectAll_Audit_approval_for_Expedite]
        /// </summary>
        public override List <AuditDetails> GetListExpediteForPurchaseOrder(System.Int32?purchaseOrderId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_selectAll_Audit_approval_for_Expedite", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@PurchaseOrderId", SqlDbType.Int).Value = purchaseOrderId;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <AuditDetails> lst    = new List <AuditDetails>();
                while (reader.Read())
                {
                    AuditDetails obj = new AuditDetails();
                    obj.AuditId      = GetReaderValue_Int32(reader, "POExpediteNotesId", 0);
                    obj.Note         = GetReaderValue_String(reader, "ExpediteNotes", "");
                    obj.UpdatedBy    = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP         = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.EmployeeName = GetReaderValue_String(reader, "EmployeeName", "");
                    obj.POLineNos    = GetReaderValue_String(reader, "POLineNos", "");
                    //[001] start
                    obj.IsMailSent = GetReaderValue_String(reader, "IsMailSent", "");
                    //[001] end
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            }
            catch (SqlException sqlex)
            {
                throw new Exception("Failed to get Expedite", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
コード例 #12
0
        public int SaveDefaultAudit()
        {
            AuditDetails audit1 = new AuditDetails();

            //audit.Id = 1;
            audit1.TemplateId    = 1;
            audit1.Location      = "CGI Mumbai";
            audit1.UserId        = "CGI Admin";
            audit1.GPSCoordinate = "20,20";
            int audit1Id = dbUpdates.SaveAuditDetail(audit1);

            //AuditDetails audit = new AuditDetails();
            ////audit.Id = 1;
            //audit.TemplateId = 1;
            //audit.Location = "Seepz Mumbai";
            //audit.UserId = "Seepz Admin";
            //audit.GPSCoordinate = "20,20";
            //int idtest= dbUpdates.SaveAuditDetail(audit);
            return(audit1Id);
        }
コード例 #13
0
        public void SaveAudit(string[] answers)
        {
            AuditDetails audit = new AuditDetails();

            //audit.Id = 1;
            audit.TemplateId    = 1;
            audit.Location      = "CGI Mumbai";
            audit.UserId        = "CGI Admin";
            audit.GPSCoordinate = "10,20";
            int auditid = SaveAuditDetail(audit);

            for (int i = 0; i < answers.Length; i++)
            {
                AuditAnswers answer = new AuditAnswers();
                answer.AuditId    = auditid;
                answer.Answer     = answers[i];
                answer.QuestionId = i + 1;
                SaveAnswer(answer);
            }
        }
コード例 #14
0
ファイル: SQLAuditProvider.cs プロジェクト: vinay1988/Ang6API
        /// <summary>
        /// Calls [usp_selectAll_Audit_approval_for_Expedite]
        /// </summary>
        public override List <AuditDetails> GetListExpediteForHUBRFQ(System.Int32?HUBRFQId)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn                 = new SqlConnection(this.ConnectionString);
                cmd                = new SqlCommand("usp_select_HUBRFQ_Expedite", cn);
                cmd.CommandType    = CommandType.StoredProcedure;
                cmd.CommandTimeout = 30;
                cmd.Parameters.Add("@HUBRFQId", SqlDbType.Int).Value = HUBRFQId;
                cn.Open();
                DbDataReader        reader = ExecuteReader(cmd);
                List <AuditDetails> lst    = new List <AuditDetails>();
                while (reader.Read())
                {
                    AuditDetails obj = new AuditDetails();
                    obj.AuditId      = GetReaderValue_Int32(reader, "HUBRFQExpediteNotesId", 0);
                    obj.Note         = GetReaderValue_String(reader, "ExpediteNotes", "");
                    obj.UpdatedBy    = GetReaderValue_NullableInt32(reader, "UpdatedBy", null);
                    obj.DLUP         = GetReaderValue_DateTime(reader, "DLUP", DateTime.MinValue);
                    obj.EmployeeName = GetReaderValue_String(reader, "EmployeeName", "");
                    obj.ReqNos       = GetReaderValue_String(reader, "ReqNo", "");
                    obj.To           = GetReaderValue_String(reader, "AssignTo", "");
                    lst.Add(obj);
                    obj = null;
                }
                return(lst);
            }
            catch (SqlException sqlex)
            {
                throw new Exception("Failed to get Expedite", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
コード例 #15
0
        public async Task <IActionResult> ShowQuestions(string projectname, string projectmanagername, string appownername, int radio1, int radio2, int radio3, int radio4, int radio5)
        {
            AuditDetails auditDetails = new AuditDetails();
            int          nos          = radio1 + radio2 + radio3 + radio4 + radio5;

            auditDetails.ApplicationOwnerName = appownername;
            auditDetails.CountOfNos           = nos;
            auditDetails.ProjectManagerName   = projectmanagername;
            auditDetails.ProjectName          = projectname;
            auditDetails.AuditType            = questionsAndTypes[0].AuditType;
            auditDetails.Userid = Convert.ToInt32(TempData.Peek("UserId"));
            _log4net.Info("ChooseAuditType Was Called !!");
            using (var httpClient = new HttpClient())
            {
                StringContent content = new StringContent(JsonConvert.SerializeObject(auditDetails), Encoding.UTF8, "application/json");
                try
                {
                    using (var response = await httpClient.PostAsync("http://localhost:34894/api/AuditSeverity", content))
                    {
                        if (response.IsSuccessStatusCode)
                        {
                            var Response = response.Content.ReadAsStringAsync().Result;
                            audit = JsonConvert.DeserializeObject <Audit>(Response);
                            _log4net.Info("Audit successfully submitted with audit ID " + auditDetails.Auditid);
                            ViewBag.message = "Success";
                        }
                    }
                }
                catch (Exception)
                {
                    TempData["ErrorMessage"] = "Audit Severity and Audit Benchmark APIs not Loaded. Please Try Later.";
                    return(RedirectToAction("Login", "Login"));
                }
                return(RedirectToAction("ShowProjectStatus"));
            }
        }
コード例 #16
0
        private void SaveAditDetails_Click(object sender, EventArgs e)
        {
            TextView     txtLocation  = FindViewById <TextView>(Resource.Id.eTextLocation);
            Spinner      spnTemplate  = FindViewById <Spinner>(Resource.Id.spnTemplates);
            int          templateId   = templateList.ElementAt(spnTemplate.SelectedItemPosition).Id;
            AuditDetails auditDetails = new AuditDetails();

            auditDetails.Location      = txtLocation.Text;
            auditDetails.TemplateId    = templateId;
            auditDetails.UserId        = "CGI Admin";//hardcoded for POC
            auditDetails.GPSCoordinate = locationCoordinates;

            //Test
            int auditI = 1;
            List <AuditDetails> audit        = manageTemplate.GetAllAudit();
            List <AuditAnswers> auditAnswers = manageTemplate.GetAuditAnswersByID(auditI);

            int Id             = manageTemplate.SaveAudit(auditDetails);
            var questionAnswer = new Intent(this, typeof(AuditQuesAnswersActivity));

            questionAnswer.PutExtra("auditId", Id.ToString());
            questionAnswer.PutExtra("isNewAudit", true.ToString());
            StartActivity(questionAnswer);
        }
コード例 #17
0
        public void DisplayEmployees()
        {
            List <PersonalDetail> employeeList                 = new List <PersonalDetail>();
            AuditDetails          firstEmpAuditDetails         = new AuditDetails("pVerma", DateTime.Today.Date.TimeOfDay);
            AuditDetails          secondEmpAuditDetails        = new AuditDetails("mSingh", DateTime.Today.Date.TimeOfDay);
            AuditDetails          thirdEmpAuditDetails         = new AuditDetails("wLou", DateTime.Today.Date.TimeOfDay);
            ProfessionalDetails   firstEmpProfessionalDetails  = new ProfessionalDetails(true, "IT");
            ProfessionalDetails   secondEmpProfessionalDetails = new ProfessionalDetails(true, "Sales");
            ProfessionalDetails   thirdEmpProfessionalDetails  = new ProfessionalDetails(true, "Operations");
            ProfessionalDetails   fourthEmpProfessionalDetails = new ProfessionalDetails(true, "Sales");
            PersonalDetail        firstEmployee                = new PersonalDetail(1, "Pallavi", "Verma", "BR6 7AE", "London", EmploymentType.FullTime, firstEmpAuditDetails, firstEmpProfessionalDetails);
            PersonalDetail        secondEmployee               = new PersonalDetail(2, "Mridul", "Singh", "BR6 7AE", "Bromley", EmploymentType.FullTime, secondEmpAuditDetails, secondEmpProfessionalDetails);
            PersonalDetail        thirdEmployee                = new PersonalDetail(3, "Lou", "Wiseman", "BR6 7DE", "Orpington", EmploymentType.FullTime, thirdEmpAuditDetails, thirdEmpProfessionalDetails);
            PersonalDetail        fourthEmployee               = new PersonalDetail(2, "Vedant", "Raj", "BR6 7AE", "Bromley", EmploymentType.FullTime, secondEmpAuditDetails, secondEmpProfessionalDetails);

            employeeList.Add(firstEmployee);
            employeeList.Add(secondEmployee);
            employeeList.Add(thirdEmployee);
            employeeList.Add(fourthEmployee);

            /* 1.Display all employee attributes provided in requirement section
             * Employee Name, Address, Employment Type, Manager, Department, UserID and LoginTime */
            foreach (PersonalDetail p in employeeList)
            {
                string isManager = String.Empty;
                if (p.ProfessionalDetails.Manager)
                {
                    isManager = "Yes";
                }
                else
                {
                    isManager = "No";
                }
                Console.WriteLine($@"Employee Name :{p.FirstName} {p.LastName}");
                Console.WriteLine($@"Address :{p.ZipCode} {p.City}");
                Console.WriteLine($@"Employment Type :{p.EmploymentType}");
                Console.WriteLine($@"Manager :{isManager}");
                Console.WriteLine($@"Department :{p.ProfessionalDetails.Department}");
                Console.WriteLine($@"UserID :{p.AuditDetails.UserID}");
                Console.WriteLine($@"LoginTime :{p.AuditDetails.LoginTime.ToString()}");
                Console.ReadLine();
            }

            //2.	Display all departments and their employees
            foreach (var d in employeeList)
            {
                Console.WriteLine($@"Department Name: {d.ProfessionalDetails.Department}, Employee Name :{d.FirstName} {d.LastName}");
                Console.ReadLine();
            }
            //3.Display department with maximum number of employees
            var dept = (from department in employeeList
                        group department by new { department.ProfessionalDetails.Department } into deptGroup
                        select new
            {
                DepartmentName = deptGroup.Key.Department,
                Count = deptGroup.Count(),
            }).ToList();

            foreach (var d in dept)
            {
                Console.WriteLine($@"Department Name : {d.DepartmentName}, Employee Count : {d.Count.ToString()}");
                Console.ReadLine();
            }
        }
コード例 #18
0
        public BaseResult AuditNo(AuditNo request)
        {
            BaseResult br = new BaseResult();

            if (null == request.id)
            {
                throw new Exception("参数异常");
            }
            try
            {
                using (var db = DbFactory.Open())
                {
                    var addtimd = Convert.ToDateTime(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                    if (request.t.Value == 0)
                    {
                        var idd = request.id.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (var id in idd)
                        {
                            var          _id           = int.Parse(id);
                            AuditDetails _AuditDetails = new AuditDetails();
                            _AuditDetails.AuditID   = _id;
                            _AuditDetails.AuditADCD = adcd;
                            _AuditDetails.AuditRole = RowID;
                            _AuditDetails.AuditTime = addtimd;
                            _AuditDetails.Remarks   = request.remarks;
                            var getanum = db.Single <Model.Audit.Audit>(w => w.ID == _id);
                            if (getanum != null)
                            {
                                _AuditDetails.AuditNums = getanum.AuditNums;
                            }
                            // _AuditDetails.AuditNums =
                            var r = db.Insert <AuditDetails>(_AuditDetails) == 1 ? true : false;
                            if (r)
                            {
                                if (RowID == 3)
                                {
                                    var s = PublicClass.GetAudit(null, AuditStatusEnums.县审批不通过.ToString());
                                    br.IsSuccess = db.ExecuteNonQuery("UPDATE Audit SET Status=" + s + " WHERE ID =" + _id + " ") > 0 ? true : false;
                                    #region 日志
                                    var           f        = db.Single <Model.Audit.Audit>(w => w.ID == _id);
                                    StringBuilder sb       = new StringBuilder();
                                    var           adcdInfo = db.Single <ADCDInfo>(w => w.adcd == f.TownADCD);
                                    sb.Append("在栏目{县级审核}下,{" + RealName + "}处理了乡镇{" + adcdInfo.adnm + "}的审批申请,处理结果:县审批不通过");
                                    _ILogHelper.WriteLog(sb.ToString(), OperationTypeEnums.更新);
                                    #endregion
                                }
                                if (RowID == 2)
                                {
                                    var s = PublicClass.GetAudit(null, AuditStatusEnums.市审批不通过.ToString());
                                    br.IsSuccess = db.ExecuteNonQuery("UPDATE Audit SET Status=" + s + " WHERE ID =" + _id + " ") > 0 ? true : false;
                                    #region 日志
                                    var           f        = db.Single <Model.Audit.Audit>(w => w.ID == _id);
                                    var           adcdInfo = db.Single <ADCDInfo>(w => w.adcd == f.TownADCD);
                                    StringBuilder sb       = new StringBuilder();
                                    sb.Append("在栏目{市级审核}下,{" + RealName + "}处理了乡镇{" + adcdInfo.adnm + "}的审批申请,处理结果:市审批不通过");
                                    _ILogHelper.WriteLog(sb.ToString(), OperationTypeEnums.更新);
                                    #endregion
                                }
                            }
                        }
                    }
                    if (request.t.Value == 1)
                    {
                        var idd = request.id.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        foreach (var id in idd)
                        {
                            var _id = int.Parse(id);
                            AuditCountyDetails _AuditCountyDetails = new AuditCountyDetails();
                            _AuditCountyDetails.CountyID  = _id;
                            _AuditCountyDetails.AuditADCD = adcd;
                            _AuditCountyDetails.AuditRole = RowID;
                            _AuditCountyDetails.AuditTime = addtimd;
                            _AuditCountyDetails.Remarks   = request.remarks;
                            var getanum = db.Single <AuditCounty>(w => w.ID == _id);
                            if (getanum != null)
                            {
                                _AuditCountyDetails.AuditNums = getanum.AuditNums;
                            }
                            var r = db.Insert <AuditCountyDetails>(_AuditCountyDetails) == 1 ? true : false;
                            if (r)
                            {
                                var s = PublicClass.GetAudit(null, AuditStatusEnums.市审批不通过.ToString());
                                br.IsSuccess = db.ExecuteNonQuery("UPDATE AuditCounty SET Status=" + s + " WHERE ID =" + _id + " ") > 0 ? true : false;
                                #region 日志
                                var           f        = db.Single <AuditCounty>(w => w.ID == _id);
                                StringBuilder sb       = new StringBuilder();
                                var           adcdInfo = db.Single <ADCDInfo>(w => w.adcd == f.CountyADCD);
                                sb.Append("在栏目{市级审核}下,{" + RealName + "}处理了乡镇{" + adcdInfo.adnm + "}的责任人审批申请,处理结果:市审批不通过");
                                _ILogHelper.WriteLog(sb.ToString(), OperationTypeEnums.更新);
                                #endregion
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                br.IsSuccess = false; br.ErrorMsg = ex.Message;
            }
            return(br);
        }
コード例 #19
0
        public async Task <IActionResult> PostAudit(AuditDetails item)
        {
            _log4net.Info("Post Audit Was Called !!");
            Dictionary <string, int> auditBenchmark = new Dictionary <string, int>();

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                using (var httpClient = new HttpClient())
                {
                    httpClient.BaseAddress = new Uri(_baseUrlForAudityBenchmarkApi);
                    httpClient.DefaultRequestHeaders.Clear();
                    httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
                    HttpResponseMessage Res = await httpClient.GetAsync("api/AuditBenchMark/" + item.AuditType);

                    if (Res.IsSuccessStatusCode)
                    {
                        _log4net.Info("Audit Benchmark For Audit Type " + item.AuditType + " Was Called !!");
                        var Response = Res.Content.ReadAsStringAsync().Result;
                        auditBenchmark = JsonConvert.DeserializeObject <Dictionary <string, int> >(Response);
                    }
                }
                int CountOfNosAllowed = auditBenchmark[item.AuditType];
                if (item.AuditType == "Internal")
                {
                    if (item.CountOfNos > CountOfNosAllowed)
                    {
                        item.ProjectExecutionStatus = "RED";
                        item.RemedialActionDuration = "Action to be taken in 2 weeks";
                    }
                    else
                    {
                        item.ProjectExecutionStatus = "GREEN";
                        item.RemedialActionDuration = "No action needed";
                    }
                }
                else
                {
                    if (item.AuditType == "SOX")
                    {
                        if (item.CountOfNos > CountOfNosAllowed)
                        {
                            item.ProjectExecutionStatus = "RED";
                            item.RemedialActionDuration = "Action to be taken in 1 week";
                        }
                        else
                        {
                            item.ProjectExecutionStatus = "GREEN";
                            item.RemedialActionDuration = "No action needed";
                        }
                    }
                }
                var addAudit = await _context.PostAudit(item);

                return(Ok(addAudit));
            }
            catch (Exception)
            {
                return(BadRequest());
            }
        }
コード例 #20
0
 public int SaveAudit(AuditDetails audit)
 {
     return(dbUpdates.SaveAuditDetail(audit));
 }
コード例 #21
0
 partial void RefreshAuditData_Execute()
 {
     AuditDetails.Refresh();
 }