コード例 #1
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult EditContact(string a)
        {
            if (Session["username"] != null)
            {
                int id     = Int32.Parse(a);
                var userid = Int32.Parse(Session["userId"].ToString());
                ft1new = c.getallftag(userid);
                lt1    = c.getallctag(userid);

                // String usertag = Session["username"].ToString();7

                c1 = dbnew.contacts1.Find(id);
                List <mobileNo> mobnums = new List <mobileNo>();
                var             mobnum  = dbnew.mobileNoes.Where(x => x.cid == id && x.uid == userid);
                foreach (var q in mobnum)
                {
                    mobileNo mns = new mobileNo();
                    mns.Id     = q.Id;
                    mns.cid    = q.cid;
                    mns.uid    = q.uid;
                    mns.mid    = q.mid;
                    mns.number = q.number;
                    mobnums.Add(mns);
                }
                ct = new contactandtags(lt1, ft1new, c1, mobnums);
                return(View(ct));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #2
0
        public ActionResult signin()
        {
            cl = new List <Contact>();

            ct = new contactandtags(null, null, cl);
            // return Redirect("../User/ProfilePage");

            return(View(ct));
        }
コード例 #3
0
        public ActionResult Index()
        {
            List <Contact> cl = new List <Contact>();



            ct = new contactandtags(null, null, cl);

            return(View(ct));
        }
コード例 #4
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult facebookmeinfo()
        {
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);
            cl     = new List <Contact>();
            ct     = new contactandtags(lt1, ft1new, cl);
            return(View(ct));
        }
コード例 #5
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult cloud()
        {
            var userid = Int32.Parse(Session["userId"].ToString());

            lt1    = c.getallctag(userid);
            ft1new = c.getallftag(userid);
            c1     = new contact1();
            ct     = new contactandtags(lt1, ft1new, c1);
            return(View(ct));
        }
コード例 #6
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult contactdetail(int id)
        {
            // String usertag = Session["username"].ToString();
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);

            c1 = dbnew.contacts1.Find(id);
            ct = new contactandtags(lt1, ft1new, c1);
            return(View(ct));
        }
コード例 #7
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult gmailimport()
        {
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);
            var gc = new List <GmailContacts>();

            //gmailcontacts gmail=new gmailcontacts();
            // gc = gmail.getall();
            ct = new contactandtags(lt1, ft1new, gc);
            return(View(ct));
        }
コード例 #8
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult showcontact(string a)
        {
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);

            String usertag = Session["username"].ToString();

            cl = cx.Contacts.Where(x => x.tagname.Equals(a) && x.username.Equals(usertag)).ToList();
            ct = new contactandtags(lt1, ft1new, cl);
            return(View(ct));
        }
コード例 #9
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult facebookimport()
        {
            String username1 = Session["username"].ToString();

            var tl     = cx.Contacts.Where(x => x.username.Equals(username1)).ToList();
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);


            ct = new contactandtags(lt1, ft1new, tl);
            return(View(ct));
        }
コード例 #10
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult gmailimportcontact()
        {
            string        email = Request["email"];
            string        pass  = Request["pass"];
            var           gc    = new List <GmailContacts>();
            gmailcontacts gmail = new gmailcontacts();

            gc = gmail.getall(email, pass);
            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);
            ct     = new contactandtags(lt1, ft1new, gc);

            return(View(ct));
        }
コード例 #11
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult mailattachfile(HttpPostedFileBase file)
        {
            if (file != null)
            {
                string pic  = System.IO.Path.GetFileName(file.FileName);
                string path = System.IO.Path.Combine(
                    Server.MapPath("~/Files"), pic);
                // file is uploaded
                file.SaveAs(path);
            }

            var userid = Int32.Parse(Session["userId"].ToString());

            ft1new = c.getallftag(userid);
            lt1    = c.getallctag(userid);
            cl     = new List <Contact>();
            ct     = new contactandtags(lt1, ft1new, cl);
            return(Redirect("Contact"));
        }
コード例 #12
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult manageftags()
        {
            if (Session["username"] != null)
            {
                cl = new List <Contact>();
                var userid = Int32.Parse(Session["userId"].ToString());
                ft1new = c.getallftag(userid);


                String user = Session["username"].ToString();
                lt1 = c.getallctag(userid);
                ct  = new contactandtags(lt1, ft1new, cl);
                return(View(ct));
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #13
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public JsonResult ShowContactdetailJSON(string a)
        {
            //var tagofafile=cx.ftagdetails

            /* int id = Int32.Parse(a);
             * contact1 c1n=null;
             * c1n = db.contacts1.Find(id);
             *
             *   // ftd = cx.ftagdetails.Where(x=>x.username.Equals(a)).ToList();
             *
             *   contactandtags cat = new contactandtags(c1n);
             *
             *   // String usertag = Session["username"].ToString();
             *
             *
             *   return this.Json(cat, JsonRequestBehavior.AllowGet);*/
            //var tagofafile=cx.ftagdetails

            int id = Int32.Parse(a);

            c1 = dbnew.contacts1.Find(id);

            contact1 c1nn = null;

            c1nn = dbnew.contacts1.Find(id);

            //  ftd = cx.ftagdetails.Where(x => x.username.Equals(a)).ToList();
            var userid = Int32.Parse(Session["userId"].ToString());

            ftd = dbnew.fTagDetails1.Where(x => x.uid == userid && x.cid == id).ToList();
            List <contactCTag> cct = new List <contactCTag>();

            cct = dbnew.contactCTags.Where(x => x.cid == id).ToList();
            int i = 0;

            lt1 = new List <userCTag>();
            foreach (var x in cct)
            {
                var uc = dbnew.userCTags.Find(cct[i].uctid);
                lt1.Add(uc);
                i++;
            }
            List <userCTag> unassignedctag = new List <userCTag>();

            unassignedctag = c.getallctag(userid);
            var unass = unassignedctag.Where(p => !lt1.Any(l => p.Id.Equals(l.Id))).ToList();



            contact1 cat1 = new contact1();

            cat1.Id                 = c1nn.Id;
            cat1.uid                = c1nn.uid;
            cat1.firstName          = c1nn.firstName;
            cat1.middleName         = c1nn.middleName;
            cat1.lastName           = c1nn.lastName;
            cat1.dob                = c1nn.dob;
            cat1.note               = c1nn.note;
            cat1.phoneticFirstName  = c1nn.phoneticFirstName;
            cat1.phoneticMiddleName = c1nn.phoneticMiddleName;
            cat1.phoneticLastName   = c1nn.phoneticLastName;
            cat1.prefix             = c1nn.prefix;
            cat1.suffix             = c1nn.suffix;
            cat1.nickName           = c1nn.nickName;
            cat1.jobTitle           = c1nn.jobTitle;
            cat1.company            = c1nn.company;
            cat1.department         = c1nn.department;

            List <fTagDetail1> a123 = new List <fTagDetail1>();

            foreach (var x in ftd)
            {
                fTagDetail1 child = new fTagDetail1();
                child.Id          = x.Id;
                child.uid         = x.uid;
                child.cid         = x.cid;
                child.orignalName = x.orignalName;
                child.virtualName = x.virtualName;
                child.url         = x.url;
                a123.Add(child);
            }
            List <userCTag> ucl         = new List <userCTag>();
            List <userCTag> uclunassign = new List <userCTag>();

            foreach (var p in lt1)
            {
                userCTag uc = new userCTag();
                uc.Id       = p.Id;
                uc.cTagName = p.cTagName;
                uc.uid      = p.uid;
                ucl.Add(uc);
            }
            foreach (var p in unass)
            {
                userCTag uc = new userCTag();
                uc.Id       = p.Id;
                uc.cTagName = p.cTagName;
                uc.uid      = p.uid;
                uclunassign.Add(uc);
            }
            List <mobileNo> mobnums = new List <mobileNo>();
            var             mobnum  = dbnew.mobileNoes.Where(x => x.cid == id && x.uid == userid);

            foreach (var q   in mobnum)
            {
                mobileNo mns = new mobileNo();
                mns.Id     = q.Id;
                mns.cid    = q.cid;
                mns.uid    = q.uid;
                mns.mid    = q.mid;
                mns.number = q.number;
                mobnums.Add(mns);
            }


            contactandtags cat = new contactandtags(cat1, a123, ucl, uclunassign, mobnums);

            // String usertag = Session["username"].ToString();


            return(this.Json(cat, JsonRequestBehavior.AllowGet));
        }
コード例 #14
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public ActionResult Contacts(string a, string u)
        {
            if (Session["username"] != null)

            {
                if (a == null && u == null)
                {
                    String usertag = Session["username"].ToString();

                    var userid = Int32.Parse(Session["userId"].ToString());
                    cl1 = dbnew.contacts1.Where(x => x.uid == userid).ToList();
                    // cl1 = db.contacts1.ToList();


                    cl1 = cl1.OrderBy(x => x.firstName).ToList();
                    for (int i = 0; i < cl1.Count; i++)
                    {
                        cl1[i].firstName = char.ToUpper(cl1[i].firstName[0]) + cl1[i].firstName.Substring(1);
                    }
                    alpha = c.getalphabetsnewdb(cl1);



                    ft1new = c.getallftag(userid);

                    lt1 = c.getallctag(userid);



                    contactandtags ct = new contactandtags(lt1, ft1new, cl1, alpha);
                    return(View(ct));
                }
                else if (a != null && u == null)
                {
                    var userid = Int32.Parse(Session["userId"].ToString());
                    ft1new = c.getallftag(userid);

                    lt1 = c.getallctag(userid);


                    cl1 = dbnew.contacts1.Where(x => x.uid == userid).ToList();
                    // cl1 = db.contacts1.ToList();


                    cl1 = cl1.OrderBy(x => x.firstName).ToList();
                    for (int i = 0; i < cl1.Count; i++)
                    {
                        cl1[i].firstName = char.ToUpper(cl1[i].firstName[0]) + cl1[i].firstName.Substring(1);
                    }
                    alpha = c.getalphabetsnewdb(cl1);

                    ct = new contactandtags(lt1, ft1new, cl1, alpha);
                    return(View(ct));
                }
                else if (a == null && u != null)
                {
                    var userid = Int32.Parse(Session["userId"].ToString());
                    ft1new = c.getallftag(userid);
                    lt1    = c.getallctag(userid);
                    String         usertag = Session["username"].ToString();
                    List <Contact> cl      = new List <Contact>();

                    cl1 = dbnew.contacts1.Where(x => x.uid == userid).ToList();
                    // cl1 = db.contacts1.ToList();


                    cl1 = cl1.OrderBy(x => x.firstName).ToList();
                    for (int i = 0; i < cl1.Count; i++)
                    {
                        cl1[i].firstName = char.ToUpper(cl1[i].firstName[0]) + cl1[i].firstName.Substring(1);
                    }
                    alpha = c.getalphabetsnewdb(cl1);

                    contactandtags ct = new contactandtags(lt1, ft1new, cl1, alpha);
                    return(View(ct));
                }
                else
                {
                    var userid = Int32.Parse(Session["userId"].ToString());
                    ft1new = c.getallftag(userid);
                    lt1    = c.getallctag(userid);
                    String usertag = Session["username"].ToString();
                    cl1 = dbnew.contacts1.Where(x => x.uid == userid).ToList();
                    // cl1 = db.contacts1.ToList();


                    cl1 = cl1.OrderBy(x => x.firstName).ToList();
                    for (int i = 0; i < cl1.Count; i++)
                    {
                        cl1[i].firstName = char.ToUpper(cl1[i].firstName[0]) + cl1[i].firstName.Substring(1);
                    }
                    alpha = c.getalphabetsnewdb(cl1);


                    contactandtags ct = new contactandtags(lt1, ft1new, cl1, alpha);
                    return(View(ct));
                }
            }
            else
            {
                return(RedirectToAction("Index", "Home"));
            }
        }
コード例 #15
0
ファイル: UserController.cs プロジェクト: sheikhma3/filefocci
        public JsonResult gettagsofselectedfile(string a)
        {
            int id = Int32.Parse(a);

            var file   = dbnew.fTagDetails1.Find(id);
            var userid = Int32.Parse(Session["userId"].ToString());

            ftd = dbnew.fTagDetails1.Where(x => x.uid == userid && x.cid == file.cid && x.url.Equals(file.url) && x.orignalName.Equals(file.orignalName)).ToList();
            //file.ftagname;
            //var tagsplits = tags.Split(',');
            ft1new = c.getallftag(userid);
            List <userFTag> assigned   = new List <userFTag>();
            List <userFTag> unassigend = new List <userFTag>();

            for (int j = 0; j < ft1new.Count; j++)
            {
                for (int k = 0; k < ftd.Count; k++)
                {
                    if (ftd[k].fid == ft1new[j].Id)
                    {
                        userFTag nn = new userFTag();
                        nn.Id       = ft1new[j].Id;
                        nn.uid      = ft1new[j].uid;
                        nn.fTagName = ft1new[j].fTagName;

                        assigned.Add(nn);
                    }
                    // else
                    {
                    }
                }
            }



            /* for (int k = 0; k < assigned.Count; k++)
             * {
             *   if(ft1new[j].Id==assigned[k].Id)
             *   {
             *
             *   }
             *   else
             *   {
             *       userFTag nn = new userFTag();
             *       nn.Id = ft1new[j].Id;
             *       nn.uid = ft1new[j].uid;
             *       nn.fTagName = ft1new[j].fTagName;
             *       unassigend.Add(nn);
             *   }
             *
             * }*/
            assigned = assigned.GroupBy(p => p.fTagName).Select(g => g.First()).ToList();
            var unassigend1 = ft1new.Where(p => !assigned.Any(l => p.fTagName.Equals(l.fTagName))).ToList();

            foreach (var v in unassigend1)
            {
                userFTag nn = new userFTag();
                nn.Id       = v.Id;
                nn.uid      = v.uid;
                nn.fTagName = v.fTagName;
                unassigend.Add(nn);
            }

            ct = new contactandtags(assigned, unassigend);
            return(Json(ct, JsonRequestBehavior.AllowGet));
        }