Example #1
0
        private CRMGroup convertToCRMGroupObject(DataRow dr)
        {
            CRMGroup CRMGroup = new CRMGroup();

            CRMGroup.Name = dr.Field <string>("Name");
            return(CRMGroup);
        }
Example #2
0
        public IList <CRMGroup> Get()
        {
            try
            {
                Logger.LogInfo("Get: CRM group process start");
                IList <CRMGroup> lstCRMGroup = new List <CRMGroup>();

                DataTable dtAppConfig = DataBase.DBService.ExecuteCommand(string.Format(SELECT_ALL));
                foreach (DataRow dr in dtAppConfig.Rows)
                {
                    CRMGroup CRMGroup = convertToCRMGroupObject(dr);
                    lstCRMGroup.Add(CRMGroup);
                }
                Logger.LogInfo("Get: CRM group process completed.");
                return(lstCRMGroup);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(null);
            }
        }
 private void btnDeleteOther_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Are you sure, you want to delete this record?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         if (this.Text == "Festivals Master")
         {
             Festivals festivals = getFestivalsData();
             if (_otherItems.Delete(festivals))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
         else if (this.Text == "CRM Groups")
         {
             CRMGroup crmGroup = getCRMGroupData();
             if (_otherItems.Delete(crmGroup))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
         else if (this.Text == "Areas")
         {
             Area area = getAreaData();
             if (_otherItems.Delete(area))
             {
                 _otherItems.LoadData(dtGridOther);
             }
         }
     }
 }
        private CRMGroup getCRMGroupData()
        {
            CRMGroup crmGroup = new CRMGroup();

            crmGroup.Name        = txtName.Text;
            crmGroup.CreatedOn   = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            crmGroup.CreatedBy   = Program.CurrentUser.Id;
            crmGroup.UpdatedOn   = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"));
            crmGroup.UpdatedBy   = Program.CurrentUser.Id;
            crmGroup.MachineName = Environment.MachineName;
            return(crmGroup);
        }
        private void saveCRMGroup()
        {
            CRMGroup crmGroup = getCRMGroupData();

            if (_otherItems.Save(crmGroup))
            {
                MessageBox.Show("Record save successfully.", "Record Saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
                _otherItems.LoadData(dtGridOther);
                grpItem.Enabled = false;
            }
            else
            {
                MessageBox.Show("Unable to save record.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #6
0
 public void Delete(CRMGroup CRMGroup)
 {
     try
     {
         DataBase.DBService.ExecuteCommand(string.Format(DELETE_BY_ID, CRMGroup.Name));
         Activity.ActivitiesService.Add(ActivityType.DeleteCRMGroup, EntryStatus.Success,
                                        Source.Server, CRMGroup.UpdatedByUserName, CRMGroup.Name, CRMGroup.MachineName);
     }
     catch (Exception ex)
     {
         StackTrace st = new StackTrace();
         StackFrame sf = st.GetFrame(0);
         MethodBase currentMethodName = sf.GetMethod();
         LogDebug(currentMethodName.Name, ex);
         throw ex;
     }
 }
Example #7
0
        public Result Delete(CRMGroup CRMGroup)
        {
            var result = new Result();

            try
            {
                CRMGroupService CRMGroupService = new CRMGroupService();
                CRMGroupService.Delete(CRMGroup);
                result.IsSuccess = true;
            }
            catch (Exception exception)
            {
                result.IsSuccess     = false;
                result.ExceptionInfo = exception;
            }
            return(result);
        }
        public bool Add(CRMGroup CRMGroup)
        {
            try
            {
                FinancialPlanner.Common.JSONSerialization jsonSerialization = new FinancialPlanner.Common.JSONSerialization();
                string apiurl = Program.WebServiceUrl + "/" + ADD_CRMGROUP_API;

                RestAPIExecutor restApiExecutor = new RestAPIExecutor();

                var restResult = restApiExecutor.Execute <CRMGroup>(apiurl, CRMGroup, "POST");

                return(true);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                return(false);
            }
        }
Example #9
0
        public void Add(CRMGroup CRMGroup)
        {
            try
            {
                string clientName = DataBase.DBService.ExecuteCommandScalar(string.Format(GET_CLIENT_NAME_QUERY, 0));

                DataBase.DBService.ExecuteCommand(string.Format(INSERT_QUERY,
                                                                CRMGroup.Name,
                                                                CRMGroup.CreatedOn.ToString("yyyy-MM-dd hh:mm:ss"), CRMGroup.CreatedBy,
                                                                CRMGroup.UpdatedOn.ToString("yyyy-MM-dd hh:mm:ss"), CRMGroup.UpdatedBy));

                Activity.ActivitiesService.Add(ActivityType.CreateCRMGroup, EntryStatus.Success,
                                               Source.Server, CRMGroup.UpdatedByUserName, CRMGroup.Name, CRMGroup.MachineName);
            }
            catch (Exception ex)
            {
                StackTrace st = new StackTrace();
                StackFrame sf = st.GetFrame(0);
                MethodBase currentMethodName = sf.GetMethod();
                LogDebug(currentMethodName.Name, ex);
                throw ex;
            }
        }
        public bool Save(object obj)
        {
            CRMGroup fest = (CRMGroup)obj;

            return(_CRMGroupInfo.Add(fest));
        }
        public bool Delete(object obj)
        {
            CRMGroup fest = (CRMGroup)obj;

            return(_CRMGroupInfo.Delete(fest));
        }