Example #1
0
        private void OnComplainAccepted_Invoked(object sender, ExternalDataEventArgs e)
        {
            ComplainAcceptedEventArgs args = (ComplainAcceptedEventArgs)e;
            ComplainDetailsRow        row  = (ComplainDetailsRow)args.UpdatedRows.Rows[0];

            IgrssAdapters.ComplainAdapter.UpdateComplainDetails(row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, row.ReceivingOfficeId, row.Subject, row.Detail, row.ComplainId, row.ComplaintNo);
        }
Example #2
0
        /// <summary>
        /// This function will add the new Complain.
        /// </summary>
        /// <returns>void</returns>
        public bool AddNewConfidentialreport(FormViewParameter Parameter, Remarks rem) //string ComplaintNo, Guid ComplaintType, Guid AgainstEmpID, Guid ComplainingEmpID, string ComplainantName, string ComplainantAddress, DateTime ComplaintDate, Guid ReceivingOfficeId, string Subject, string Detail)
        {
            string             curUser = Thread.CurrentPrincipal.Identity.Name;
            int                i       = 0;
            ComplainDetailsRow row     = (ComplainDetailsRow)Parameter.Values;

            try
            {
                Guid ComplainId   = FileManager.OpenNewFile(row.ReceivingOfficeId, "COM");
                int  rowsAffected = 0;
                if (row.ComplaintType == new Guid("85aefd8d-6b7e-4ab8-b124-21b52073f7b3"))
                {
                    i = IgrssAdapters.ComplainAdapter.AddNewComplainDetails(ComplainId, row.ComplaintNo, row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, row.ReceivingOfficeId, row.Subject, row.Detail, curUser, DateTime.Now, row.Designation, row.CurrentOffice);
                }
                if (row.ComplaintType == new Guid("96369687-0450-42fc-ba41-ad35ade13b53"))
                {
                    i = IgrssAdapters.ComplainAdapter.AddNewComplainDetails(ComplainId, row.ComplaintNo, row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, null, row.Subject, row.Detail, curUser, DateTime.Now, row.Designation, null);
                }
                return(true);
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DAL"))
                {
                    throw;
                }
                return(false);
            }
        }
Example #3
0
        /// <summary>
        /// This function will add the new Complain.
        /// </summary>
        /// <returns>void</returns>
        public bool AddNewComplain(FormViewParameter Parameter, Remarks rem) //string ComplaintNo, Guid ComplaintType, Guid AgainstEmpID, Guid ComplainingEmpID, string ComplainantName, string ComplainantAddress, DateTime ComplaintDate, Guid ReceivingOfficeId, string Subject, string Detail)
        {
            string             curUser = Thread.CurrentPrincipal.Identity.Name;
            int                i       = 0;
            ComplainDetailsRow row     = (ComplainDetailsRow)Parameter.Values;

            try
            {
                Guid ComplainId = FileManager.OpenNewFile(row.ReceivingOfficeId, "COM");
                // Commented By Akhilesh.
                //if (rem.Subject != "" && rem.Body != "")
                //{
                //    FileManager.AddRemarkToFile(ComplainId, rem.Subject, rem.Body);
                //}
                int rowsAffected = 0;
                if (row.ComplaintType == new Guid("85aefd8d-6b7e-4ab8-b124-21b52073f7b3"))
                {
                    i = IgrssAdapters.ComplainAdapter.AddNewComplainDetails(ComplainId, row.ComplaintNo, row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, row.ReceivingOfficeId, row.Subject, row.Detail, curUser, DateTime.Now, row.Designation, row.CurrentOffice);
                }
                if (row.ComplaintType == new Guid("96369687-0450-42fc-ba41-ad35ade13b53"))
                {
                    i = IgrssAdapters.ComplainAdapter.AddNewComplainDetails(ComplainId, row.ComplaintNo, row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, null, row.Subject, row.Detail, curUser, DateTime.Now, row.Designation, null);
                }
                if (i > 0)
                {
                    Dictionary <string, object> WfParams = new Dictionary <string, object>();
                    WfParams.Add("ComplainId", ComplainId);
                    WfParams.Add("ComplainOffice", row.ReceivingOfficeId);

                    WorkflowResults WfResult = WorkflowMediator.RunWorkflow(typeof(ComplainProcess), WfParams);

                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DAL"))
                {
                    throw;
                }
                return(false);
            }
        }
        public ComplainAcceptedEventArgs(Guid InstanceId, Guid ComplaintType, Guid AgainstEmpID, Guid ComplainingEmpID, string ComplainantName, string ComplainantAddress, DateTime ComplaintDate, Guid ReceivingOfficeId, string Subject, string Detail, Guid ComplainId, string ComplaintNo)
            : base(InstanceId)
        {
            UpdatedRows = new CompalinTable();
            ComplainDetailsRow row = UpdatedRows.NewComplainDetailsRow();

            row.ComplaintType      = ComplaintType;
            row.AgainstEmpID       = AgainstEmpID;
            row.ComplainingEmpID   = ComplainingEmpID;
            row.ComplainantName    = ComplainantName;
            row.ComplainantAddress = ComplainantAddress;
            row.ComplaintDate      = ComplaintDate;
            row.ReceivingOfficeId  = ReceivingOfficeId;
            row.Subject            = Subject;
            row.Detail             = Detail;
            row.ComplainId         = ComplainId;
            row.ComplaintNo        = ComplaintNo;
            UpdatedRows.Rows.Add(row);
        }
Example #5
0
        /// <summary>
        /// This function will Update the Complain details.
        /// </summary>
        /// <returns>void</returns>
        public bool UpdateComplainDetails(FormViewParameter Parameter, Guid ComplainId)        //Guid ComplaintType, Guid AgainstEmpID, Guid ComplainingEmpID, string ComplainantName, string ComplainantAddress, Guid ReceivingOfficeId, string Subject, string Detail, string ComplaintNo, DateTime ComplaintDate, Guid ComplainId)
        {
            string             curUser = Thread.CurrentPrincipal.Identity.Name;
            ComplainDetailsRow row     = (ComplainDetailsRow)Parameter.Values;

            try
            {
                Guid InstanceId = (Guid)IgrssAdapters.ComplainAdapter.GetWfIdByComplainId(ComplainId);
                ComplainAcceptedEventArgs args = new ComplainAcceptedEventArgs(InstanceId, row.ComplaintType, row.AgainstEmpID, row.ComplainingEmpID, row.ComplainantName, row.ComplainantAddress, row.ComplaintDate, row.ReceivingOfficeId, row.Subject, row.Detail, ComplainId, row.ComplaintNo);
                //WorkflowMediator.ComplainServices.AcceptComplain(InstanceId, args);
                return(true);
            }
            catch (Exception ex)
            {
                if (ExceptionPolicy.HandleException(ex, "DAL"))
                {
                    throw;
                }
                return(false);
            }
        }