Example #1
0
 protected void rptFolders_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Footer))
     {
         if (e.CommandName == "UserDetail")
         {
             this.smUserID = Convert.ToInt32(e.CommandArgument);
             this.smEmployeeSearchResultUserIDs = new ArrayList();
             this.smEmployeeSearchResultUserIDs.Add(this.smUserID);
             this.smMemberType = PIKCV.COM.EnumDB.MemberTypes.TemporaryUser;
             this.smIsLogin    = true;
             Session.Remove(PIKCV.COM.EnumUtil.Sess.EmployeeSearchQueries.ToString());
             Response.Write("<script>window.open('TemporaryUsers/TemporaryUsersUserInfo.aspx', 'PikcvKullanýcýDetay', 'toolbar=no, scrollbars, width=815, height=650')</script>");
         }
         else
         {
             PIKCV.BUS.Company obj      = new PIKCV.BUS.Company();
             ArrayList         arrUsers = new ArrayList();
             if (Request.Form["chFolders"] != null)
             {
                 arrUsers.AddRange(Request.Form["chFolders"].ToString().Split(','));
                 if (e.CommandName == "Delete")
                 {
                     if (obj.DeleteUserFromFolder(this.FolderID, arrUsers))
                     {
                         Response.Write("<script> { alert('Seçtiðiniz kullanýcýlar silinmiþtir');}</script>");
                     }
                     else
                     {
                         Response.Write("<script> { alert('Seçtiðiniz kullanýcýlar silinirken bir hata oluþtu');}</script>");
                     }
                 }
                 else if (e.CommandName == "SendToFolder")
                 {
                     if (obj.UpdateUsersFolders(this.FolderID, this.FolderIDToSend, arrUsers, this.smTemporaryUserID))
                     {
                         Response.Write("<script> { alert('Belirlediðiniz kullanýcýlar seçtiðiniz klasöre taþýnmýþtýr');}</script>");
                     }
                     else
                     {
                         Response.Write("<script> { alert('Taþýnma sýrasýnda bir hata oluþtu. Lütfen tekrar deneyin');}</script>");
                     }
                 }
             }
             else
             {
                 Response.Write("<script> { alert(' " + PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SelectAtLeastOneUser) + "');}</script>");
             }
         }
         FillForm();
     }
 }
Example #2
0
    protected void rptFolders_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem) || (e.Item.ItemType == ListItemType.Footer))
        {
            PIKCV.BUS.Company obj          = new PIKCV.BUS.Company();
            ArrayList         arrUsers     = new ArrayList();
            int    UsersSuccessfullBoughts = 0;
            string Message = "";
            if (e.CommandName == "UserDetail")
            {
                this.smUserID = Convert.ToInt32(e.CommandArgument);
                this.smEmployeeSearchResultUserIDs = new ArrayList();
                this.smEmployeeSearchResultUserIDs.Add(this.smUserID);
                Session.Remove(PIKCV.COM.EnumUtil.Sess.EmployeeSearchQueries.ToString());
                this.Redirect("Company-Membership-UserInfo");
            }
            if (Request.Form["chFolders"] != null)
            {
                arrUsers.AddRange(Request.Form["chFolders"].ToString().Split(','));
                if (e.CommandName == "CopyToFolder")
                {
                    if (obj.InsertUsersToFolder(int.Parse(((DropDownList)e.Item.FindControl("drpCopyCutFolderNames")).SelectedValue), arrUsers))
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.CopyToFolderSuccess));
                    }
                    else
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.CopyTofolderFailed));
                    }
                }
                else if (e.CommandName == "CutToFolder")
                {
                    if (obj.UpdateUsersFolders(this.FolderID, int.Parse(((DropDownList)e.Item.FindControl("drpCopyCutFolderNames")).SelectedValue), arrUsers))
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.CutToFolderSuccess));
                    }
                    else
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.CutToFolderFailed));
                    }
                }
                else if (e.CommandName == "OpenInterviewPage")
                {
                    int       TotalUserCount = arrUsers.Count;
                    int       BoughtUsers    = 0;
                    ArrayList arrUsersInterviewWillBeSent = new ArrayList();
                    for (int i = 0; i < arrUsers.Count; i++)
                    {
                        PIKCV.BUS.Company objCompany = new PIKCV.BUS.Company();
                        if (objCompany.CheckBuyContactInfo(this.smCompanyID, Convert.ToInt32(arrUsers[i])))
                        {
                            BoughtUsers++;
                            arrUsersInterviewWillBeSent.Add(arrUsers[i]);
                        }
                    }
                    this.smBuyContactInfoResultUserIDs = arrUsersInterviewWillBeSent;
                    this.smInterviewUserIDs            = arrUsers;
                    if (arrUsersInterviewWillBeSent.Count == arrUsers.Count)
                    {
                        dvScript.InnerHtml = "<script>var wpen = window.open('InsertInterview.aspx', 'PikcvMülakataÇaðýr', 'width=400,height=400,toolbar=no');wpen.focus();</script>";
                    }
                    else if (arrUsersInterviewWillBeSent.Count == 0)
                    {
                        dvScript.InnerHtml = "<script>alert('" + PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.UsersWhichDidNotBoughtBeforeInterviewWarning) + "');</script>";
                    }
                    else if (arrUsersInterviewWillBeSent.Count != arrUsers.Count)
                    {
                        Message = "Company-BuyContactInfo-BuyContactInfoResult&UserCount=" + arrUsers.Count.ToString()
                                  + "&BuyContactInfoResultPageType=" + ((int)PIKCV.COM.Enumerations.BuyContactInfoResultPageType.InsertInterview).ToString();
                        this.Redirect(Message);
                    }
                }
                else if (e.CommandName == "Delete")
                {
                    if (obj.DeleteUserFromFolder(this.FolderID, arrUsers))
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.DeleteFromFolderSuccsess));
                    }
                    else
                    {
                        dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.DeleteFromFolderFailed));
                    }
                }
                else if (e.CommandName == "SendMessage")
                {
                    int       TotalUserCount            = arrUsers.Count;
                    int       BoughtUsers               = 0;
                    ArrayList arrUsersMessageWillBeSent = new ArrayList();
                    for (int i = 0; i < arrUsers.Count; i++)
                    {
                        PIKCV.BUS.Company objCompany = new PIKCV.BUS.Company();
                        if (objCompany.CheckBuyContactInfo(this.smCompanyID, Convert.ToInt32(arrUsers[i])))
                        {
                            BoughtUsers++;
                            arrUsersMessageWillBeSent.Add(arrUsers[i]);
                        }
                    }

                    this.smMessageUserIDs = arrUsers;
                    this.smBuyContactInfoResultUserIDs = arrUsersMessageWillBeSent;
                    if (arrUsersMessageWillBeSent.Count == arrUsers.Count)
                    {
                        this.Redirect("Company-Messages-SendMessage");
                    }
                    else if (arrUsersMessageWillBeSent.Count == 0)
                    {
                        dvScript.InnerHtml = "<script>alert('" + PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.UsersWhichDidNotBoughtBeforeMessageWarning) + "');</script>";
                    }
                    else if (arrUsersMessageWillBeSent.Count != arrUsers.Count)
                    {
                        Message = "Company-BuyContactInfo-BuyContactInfoResult&UserCount=" + arrUsers.Count.ToString()
                                  + "&BuyContactInfoResultPageType=" + ((int)PIKCV.COM.Enumerations.BuyContactInfoResultPageType.SendMessage).ToString();
                        this.Redirect(Message);
                    }
                }
                else if (e.CommandName == "BuyCommunicationInformation")
                {
                    PIKCV.BUS.Company objComp = new PIKCV.BUS.Company();
                    //int Difference = 0;

                    ArrayList arrUsersToBought = new ArrayList();
                    for (int i = 0; i < arrUsers.Count; i++)
                    {
                        if (!(objComp.CheckBuyContactInfo(this.smCompanyID, Convert.ToInt32(arrUsers[i]))))
                        {
                            arrUsersToBought.Add(arrUsers[i]);
                        }
                    }

                    if (arrUsersToBought.Count == 0)
                    {
                        Message = "Seçtiðiniz adaylarýn iletiþim bilgileri daha önce satýn alýnmýþtýr. Bilgilere satýn alýnan iletiþim bilgileri klasöründen ulaþabilirsiniz";
                    }
                    else
                    {
                        if (arrUsersToBought.Count == arrUsers.Count)
                        {
                            PIKCV.COM.Enumerations.BuyContactInfoResult BuyComtactInfoResult = objComp.BuyContactInfo(this.smCompanyID, arrUsersToBought, 0, ref UsersSuccessfullBoughts);
                            switch (BuyComtactInfoResult)
                            {
                            case PIKCV.COM.Enumerations.BuyContactInfoResult.Success:
                                DataTable dt = objComp.GetCompanyInfo(this.smCompanyID);
                                if (dt.Rows.Count > 0)
                                {
                                    this.smPikCredi = dt.Rows[0]["Credits"].ToString();
                                }
                                Message = "Seçtiðiniz adaylarýn iletiþim bilgileri satýnalýnmýþtýr." +
                                          "Bilgilere satýnalýnan iletiþim bilgileri klasöründen ulaþabilirsiniz." +
                                          "Kalan krediniz:" + this.smPikCredi.ToString();
                                break;

                            case PIKCV.COM.Enumerations.BuyContactInfoResult.Failed:
                                Message            = PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.BuyContactInfoFailed);
                                dvScript.InnerHtml = SendFolderMessage(Message);
                                break;

                            case PIKCV.COM.Enumerations.BuyContactInfoResult.NotEnoughPikCredi:
                                this.Redirect("Company-Jobs-Jobs-NoCredit");
                                //Response.Write("<script>alert('" + PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.NoCredit) + "');" + "window.location.href('Pikcv.aspx?Pik=Company-Credits-SelectPaymentType');" + "</script>");
                                break;
                            }
                            dvScript.InnerHtml = SendFolderMessage(Message);
                        }
                        else if (arrUsersToBought.Count != arrUsers.Count)
                        {
                            this.smBuyContactInfoResultUserIDs = arrUsersToBought;
                            Message = "Company-BuyContactInfo-BuyContactInfoResult&UserCount=" + arrUsers.Count.ToString()
                                      + "&BuyContactInfoResultPageType=" + ((int)PIKCV.COM.Enumerations.BuyContactInfoResultPageType.BuyContactInfo).ToString();
                            this.Redirect(Message);
                        }
                    }

                    dvScript.InnerHtml = "<script>alert('" + Message + "');</script>";
                }
            }
            else
            {
                dvScript.InnerHtml = SendFolderMessage(PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SelectAtLeastOneUser));
            }
            FillFolderDetailRepeater();
        }
    }