예제 #1
0
 protected void lnkSendToFolder_Click(object sender, EventArgs e)
 {
     string ErrMsg = String.Empty;
     PIKCV.BUS.Company Comp = new PIKCV.BUS.Company();
     ArrayList arr = new ArrayList(1);
     arr.Insert(0, this.smUserID);
     if (Comp.InsertUsersToFolder(Convert.ToInt32(ddlCompanyFolders.SelectedValue), arr))
     {
         ErrMsg = PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SendToFolderSuccess);
     }
     else
     {
         ErrMsg = PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SendToFolderFailed);
     }
     dvScript.InnerHtml = "<script>alert('" + ErrMsg + "');</script>";
 }
예제 #2
0
    protected void SendToFolder_Click(object sender, EventArgs e)
    {
        PIKCV.BUS.Company Comp = new PIKCV.BUS.Company();
        ArrayList         arr  = new ArrayList();

        foreach (RepeaterItem item in rptEmployees.Items)
        {
            if (((CheckBox)item.FindControl("CheckBox")).Checked)
            {
                arr.Add(Convert.ToInt32(((Literal)item.FindControl("ltlUserID")).Text));
            }
        }
        string ErrMsg = String.Empty;

        if (Comp.InsertUsersToFolder(Convert.ToInt32(ddlCompanyFolders.SelectedValue), arr))
        {
            ErrMsg = PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SendToFolderSuccess);
        }
        else
        {
            ErrMsg = PIKCV.COM.Data.GetErrorMessageCache(this.cmbErrors, PIKCV.COM.EnumDB.ErrorTypes.SendToFolderFailed);
        }
        this.strAlert += "alert('" + ErrMsg + "');";
    }
예제 #3
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();
        }
    }