Exemple #1
0
        public void insertsendtemp(string case_id, string agent_id, CaseViewModel caseviewmodel)
        {
            CaseviewPersistence caseviewpersistence = new CaseviewPersistence();
            string strqu = "'" + case_id + "','" + caseviewmodel.txtempname + "','" + caseviewmodel.txtcompany + "','" + caseviewmodel.txtemail + "','" + caseviewmodel.send_template + "','" + DateTime.Now + "','" + DateTime.Now + "')";

            caseviewpersistence.insertsendtemptable(strqu);
            insertbottrigger(case_id, "send_template");
        }
Exemple #2
0
        public void insertbottrigger(string case_id, string sendtemplate)
        {
            CaseviewPersistence caseviewpersistence = new CaseviewPersistence();
            string strqu = "'" + case_id + "','" + sendtemplate + "','" + DateTime.Now + "','" + DateTime.Now + "',0)";


            caseviewpersistence.insertbottriggertable(strqu);
            // return strqu;
        }
Exemple #3
0
        //insert a date  primary requirements table
        public void caseviewrequirements(string case_id, string[] requirements, string [] chackboxrequirements)
        {
            CaseviewPersistence caseviewpersistence = new CaseviewPersistence();

            for (int i = 0; i < requirements.Length; i++)
            {
                int itm = 0;
                if (requirements[i] != "")
                {
                    if (chackboxrequirements != null)
                    {
                        if (chackboxrequirements.Contains(i.ToString()))
                        {
                            // int requirement = selectattempt(chackboxrequirements[i]);
                            itm = 1;
                            string strqu = "'" + case_id + "','" + requirements[i].Trim() + "','" + true + "','" + DateTime.Now + "','" + DateTime.Now + "')";
                            caseviewpersistence.insertprimarytable(strqu, itm);
                        }
                        else
                        {
                            itm = 2;
                            string strqu = "'" + case_id + "' ,'" + requirements[i] + "' ,'" + false + "' ,'" + DateTime.Now + "','" + DateTime.Now + "')";
                            caseviewpersistence.insertprimarytable(strqu, itm);
                            //ctx.Database.ExecuteSqlCommand(strqu);
                        }
                    }
                    else
                    {
                        itm = 3;
                        string strqu = "'" + case_id + "' ,'" + requirements[i] + "' ,'" + false + "' ,'" + DateTime.Now + "','" + DateTime.Now + "')";
                        caseviewpersistence.insertprimarytable(strqu, itm);
                    }
                }
                //if(amounts[i] != "" && chackbox[i] == null)
                //{
                //    //int attemts = indexservices.selectattempt(chackbox[i]);

                //}
            }
        }
Exemple #4
0
        //insert a DATA agent_case_attempts_made AND add_case_notes ,update follow_up_date as case_details table
        public void insertcasenotes(string case_id, string agent_id, CaseViewModel caseviewmodel)
        {
            CaseviewPersistence caseviewpersistence = new CaseviewPersistence();
            DateTime            dt  = new DateTime();
            DateTime            dt1 = new DateTime();
            string attempt          = selectattempt(caseviewmodel.cheattempt1, caseviewmodel.cheattempt2, caseviewmodel.cheattempt3);
            int    priority         = 0;

            if (caseviewmodel.setpriority == "1")
            {
                priority = 1;
            }
            if (caseviewmodel.timer1 == null)
            {
            }
            else
            {
                string date = caseviewmodel.timer1?.ToString("hh:mm tt");
                caseviewmodel.datepicker1 = caseviewmodel.datepicker1 + " " + date;
                dt = Convert.ToDateTime(caseviewmodel.datepicker1);
                if (caseviewmodel.setpriority == "1")
                {
                    priority = 1;
                }
            }
            if (caseviewmodel.timer2 == null)
            {
            }
            else
            {
                string date = caseviewmodel.timer2?.ToString("hh:mm tt");
                caseviewmodel.datepicker2 = caseviewmodel.datepicker2 + " " + date;
                dt = Convert.ToDateTime(caseviewmodel.datepicker2);
                if (caseviewmodel.setpriority2 == "1")
                {
                    priority = 1;
                }
            }
            if (caseviewmodel.timer3 == null)
            {
            }
            else
            {
                string date = caseviewmodel.timer3?.ToString("hh:mm tt");
                caseviewmodel.datepicker3 = caseviewmodel.datepicker3 + " " + date;
                dt = Convert.ToDateTime(caseviewmodel.datepicker3);
                if (caseviewmodel.setpriority3 == "1")
                {
                    priority = 1;
                }
            }
            if (caseviewmodel.txtfollowupdate != null)
            {
                dt1 = Convert.ToDateTime(caseviewmodel.txtfollowupdate);
            }


            AddCasenotesModel addcase = caseviewpersistence.selecttrigerandtraking(case_id);    //insertsaveandupdate

            if (priority != 0)
            {
                caseviewpersistence.updatecasedetailspriority(case_id, priority);
            }

            //insertprimarytable
            if (caseviewmodel.txtremarks != null)
            {
                if (attempt != null)
                {
                    int    itm1   = 1;
                    string strqu1 = "'" + case_id + "' ,'" + agent_id + "' ,'" + attempt + "' ,'" + dt + "' ,'" + priority + "')";
                    //string strqu1=
                    caseviewpersistence.insertsaveandupdate(strqu1, itm1, case_id, caseviewmodel.txtfollowupdate);
                }
                if (caseviewmodel.Deadline1 != Convert.ToDateTime("1/1/0001 12:00:00 AM"))
                {
                    caseviewpersistence.updatedeadline(case_id, caseviewmodel.Deadline1);
                }

                int itm      = 2;
                int attempts = caseviewpersistence.attemptsmadecount(case_id);
                if (attempts == -51)
                {
                }
                else if (caseviewmodel.atemtcount != null)
                {
                    caseviewpersistence.updatecasetable(attempts + 1, case_id);
                }
                if (caseviewmodel.atemtcount != null)
                {
                    //addcase.trigger_phone---->caseviewmodel.txtphone
                    attempts = attempts + 1;
                    string strqu = "'" + case_id + "' ,'" + caseviewmodel.txtphone + "' ,'" + caseviewmodel.txtspoke +
                                   "' ,'" + caseviewmodel.txtvmail + "','" + caseviewmodel.txtinforeq + "','" + caseviewmodel.txtinforec + "','" + addcase.tracking + "','" + caseviewmodel.txtdeadline
                                   + "','" + attempts + "','" + dt1 + "','" + caseviewmodel.txtremarks + "','" + DateTime.Now + "','" + DateTime.Now + "','" + agent_id + "')";


                    caseviewpersistence.insertsaveandupdate(strqu, itm, case_id, caseviewmodel.txtfollowupdate);
                }
                else if (caseviewmodel.txtremarks != null)
                {
                    string strqu = "'" + case_id + "' ,'" + caseviewmodel.txtremarks + "','" + DateTime.Now + "','" + DateTime.Now + "','" + agent_id + "')";
                    caseviewpersistence.insertremarks(strqu);
                }

                //insertbottrigger(case_id, "save and update");
                //ctx.Database.ExecuteSqlCommand(strqu);
                if (caseviewmodel.btnsave == "Save & Update")
                {
                    insertbottrigger(case_id, "save_update");
                }
                if (caseviewmodel.btnsaveandreturn == "Save & Return")
                {
                    string strq = "" + 1 + ",'" + case_id + "','" + DateTime.Now + "','" + DateTime.Now + "')";
                    caseviewpersistence.insertstatustable(strq);
                    insertbottrigger(case_id, "save_return");
                }
            }

            if (caseviewmodel.alternatetitle != null)
            {
                caseviewpersistence.updatecasealternatetitle(caseviewmodel.alternatetitle, case_id);
            }
            if (caseviewmodel.CasetoUtl != null)
            {
                if (caseviewmodel.CasetoUtl == "on" || caseviewmodel.CasetoUtl == "ON")
                {
                    caseviewmodel.CasetoUtl = "UTL";
                }
                caseviewpersistence.updatecasetable(caseviewmodel.CasetoUtl, case_id);
            }
            if (caseviewmodel.chkSupervisor != null)
            {
                if (caseviewmodel.chkSupervisor == "Supervisor")
                {
                    caseviewpersistence.updatecasetable("Supervisor", case_id);
                }
                else if (caseviewmodel.chkSupervisor == "Blockedaccounts")
                {
                    caseviewpersistence.updatecasetable("Blockedaccounts", case_id);
                }
                else if (caseviewmodel.chkSupervisor == "Hours")
                {
                    caseviewpersistence.updatecasetable("24Hours", case_id);
                }
                else if (caseviewmodel.chkSupervisor == "clearselection")
                {
                    caseviewpersistence.updatecasetable("clearselection", case_id);
                }
            }
            //if (caseviewmodel.chkSupervisor != null)
            //{
            //    if (caseviewmodel.chkSupervisor == "Blockedaccounts")
            //    {
            //        caseviewpersistence.updatecasetable("Blockedaccounts", case_id);
            //    }

            //}
            //if (caseviewmodel.chkhours  != null)
            //{
            //    if (caseviewmodel.chkhours == "Hours")
            //    {
            //        caseviewpersistence.updatecasetable("24Hours", case_id);
            //    }

            //}
        }