protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         try
         {
             EncryptedQueryString args = new EncryptedQueryString(Request.QueryString["args"]);
             if (args.Count < 1)
             {
                 btnReset.Enabled = false;
                 throw new Exception("Invalid User!");
             }
             foreach (var arg in args)
             {
                 Label label = new Label();
                 label.Text = String.Format("{0}={1}", arg.Key, HttpUtility.HtmlEncode(arg.Value));
                 login_id = label.Text;
             }
             if (login_id == "")
             {
                 btnReset.Enabled = false;
                 throw new Exception("Invalid User!");
             }
             string[] b = login_id.Split('=');
             login_id = b[1];
         }
         catch (Exception ex)
         {
             lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
             lbResponse.Text = ex.Message;
         }
     }
 }
    protected void btnforget_Click(object sender, EventArgs e)
    {
        using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
        {
            var counter = from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == txtEmail.Text select a;

            if (counter.Count()==1)
            {
                var getval = counter.FirstOrDefault();
                EncryptedQueryString args = new EncryptedQueryString();
                args["arg1"] = txtEmail.Text;
                string url = string.Format("http://*****:*****@gmail.com");
                msg.To.Add(txtEmail.Text);
                msg.Subject = "Activation Mail From icons";
                StringBuilder sb = new StringBuilder();
                sb.Append("<table><tr><td colspan='2'>Hi,&nbsp;" +getval.Full_Name + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means&nbsp;<a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td>   Email:</td><td>" + txtEmail.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>");
                msg.Body = sb.ToString();
                msg.IsBodyHtml = true;
                msg.Priority = MailPriority.High;
                MailSender ms = new MailSender();
                ms.SendMailUsingGmail(msg);
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#006600");
                lbResponse.Text = "Password Link sent to your Mail Id!";
            }
            else
            {
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
                lbResponse.Text = "Invalid Email Id!";
            }
        }
    }
Exemplo n.º 3
0
        protected void gvSponsorships_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                DataRowView row = (DataRowView)e.Row.DataItem;

                string url = Utility.GetBBISPageUrl(MyContent.MoreInfoPageID);

                string moreInfoUrl = url + "{0}id=" + row["ID"];
                moreInfoUrl = moreInfoUrl.IndexOf("?") > -1 ? String.Format(moreInfoUrl, "&") : String.Format(moreInfoUrl, "?");
                moreInfoUrl = moreInfoUrl + "&sponsored=y";

                ((LinkButton)e.Row.FindControl("lnkNo")).PostBackUrl         = moreInfoUrl;
                ((LinkButton)e.Row.FindControl("lnkName")).PostBackUrl       = moreInfoUrl;
                ((ImageButton)e.Row.FindControl("imgThumbnail")).ImageUrl    = "ImageHandler.ashx?context=sponsorship&type=" + MyContent.ThumbnailNoteType + "&id=" + row["Id"];
                ((ImageButton)e.Row.FindControl("imgThumbnail")).PostBackUrl = moreInfoUrl;

                if (e.Row.FindControl("lnkEmail") != null)
                {
                    var lnkEmail = (HyperLink)e.Row.FindControl("lnkEmail");

                    EncryptedQueryString args = new EncryptedQueryString();
                    args["CHILDID"]     = row["Child No"].ToString();
                    args["CHILDNAME"]   = row["Child Name"].ToString();
                    args["SPONSORID"]   = row["SPONSORID"].ToString();   //need to get this
                    args["SPONSORNAME"] = row["SPONSORNAME"].ToString(); //need to get this

                    string emailUrl = string.Concat(Utility.GetBBISPageUrl(MyContent.EmailPageID), string.Format("?args={0}", args.ToString()));

                    lnkEmail.NavigateUrl = emailUrl;
                }
            }
        }
    protected void SendCommand_Click(object sender, EventArgs e)
    {
        EncryptedQueryString QueryString = new EncryptedQueryString();

        QueryString.Add("MyData", MyData.Text);
        QueryString.Add("MyTime", DateTime.Now.ToLongTimeString());
        QueryString.Add("MyDate", DateTime.Now.ToLongDateString());

        Response.Redirect("QueryStringRecipient.aspx?data=" + QueryString.ToString());
    }
 protected void btnRegister_Click(object sender, EventArgs e)
 {
     lbResponse.Text = string.Empty;
     //System.Threading.Thread.Sleep(100000000);
     if (cbterms.Checked)
     {
         int a = 0;
         if (cbsubscription.Checked)
         {
             a = 1;
         }
         using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
         {
             string path = "~/Images/Profile/default_person.jpg";
             var counter = from b in dataDB.Photo_CustomerRegistrationDetails where b.Email == txtEmail.Text select b;
             if (counter.Count() == 0)
             {
                 Photo_CustomerRegistrationDetailBL obj = new Photo_CustomerRegistrationDetailBL(0, txtEmail.Text, txtPassword.Text, 0, path, txtFullName.Text, 1, 0, a, a, DateTime.Now, DateTime.MaxValue, DateTime.MaxValue, 0, 0);
                 if (obj.Insert())
                 {
                     EncryptedQueryString args = new EncryptedQueryString();
                     args["arg1"] = txtEmail.Text;
                     string url = string.Format("http://*****:*****@gmail.com");
                     msg.To.Add(txtEmail.Text);
                     msg.Subject = "Activation Mail From icons";
                     StringBuilder sb = new StringBuilder();
                     sb.Append("<table><tr><td colspan='2'>Hi,&nbsp;" + txtFullName.Text + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means&nbsp;<a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td>   Email:</td><td>" + txtEmail.Text + "</td></tr><tr><td>Password:</td><td>" + txtPassword.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>");
                     msg.Body = sb.ToString();
                     msg.IsBodyHtml = true;
                     msg.Priority = MailPriority.High;
                     MailSender ms = new MailSender();
                     ms.SendMailUsingGmail(msg);
                     lbResponse.Text = "Validation mail send to your Id. Please, Check to activate your account...!";
                     emptyfield();
                 }
             }
             else
             {
                 lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230");
                 lbResponse.Text = "Email Id Already exist!";
             }
         }
     }
     else
     {
         lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230");
         lbResponse.Text = "Check the terms & conditions";
     }
 }
Exemplo n.º 6
0
 public string getCardUrl(Employee emp)
 {
     EncryptedQueryString QueryString = new EncryptedQueryString();
     QueryString.Add("start_date", StartDateOfPeriod);
     QueryString.Add("end_date", EndDateOfPeriod);
     QueryString.Add("role", role);
     QueryString.Add("month_id", period.SelectedItem.Value);
     QueryString.Add("date", period.SelectedItem.Text);
     QueryString.Add("emp_id", emp.EmployeeID);
     QueryString.Add("emp_begda", emp.BeginDate);
     QueryString.Add("emp_endda", emp.EndDate);
     QueryString.Add("count_days", count_days.ToString());
     string url = "Card.aspx?card=" + QueryString.ToString();
     return url;
 }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        // Deserialize the encrypted query string
        EncryptedQueryString QueryString =
            new EncryptedQueryString(Request.QueryString["data"]);

        // Write information to the screen
        StringBuilder Info = new StringBuilder();

        foreach (String key in QueryString.Keys)
        {
            Info.AppendFormat("{0} = {1}<br>", key, QueryString[key]);
        }
        QueryStringLabel.Text = Info.ToString();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) Response.Redirect("Default.aspx");

        // выводим доступные кнопки
        Person user = (Person)Session["User"];
        Display disp = new Display();
        //if (user.Roles == null) ContentPlaceHolder1.Visible = false;
        MenuBar.Text = disp.DisplayMenuBar(user.Roles);

        if (Request.QueryString["url"] != null)
        {
            EncryptedQueryString QueryString = new EncryptedQueryString(Request.QueryString["url"]);
            PageToLoad = QueryString["page"];
        }
    }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["args"] != null)
                {
                    var args = new EncryptedQueryString(Request.QueryString["args"]);
                    _childid   = args["CHILDID"];
                    _childname = args["CHILDNAME"];

                    lblChildID.Text   = string.Format("Child ID: {0}", _childid);
                    lblChildName.Text = string.Format("Child Name: {0}", _childname);
                }
                else
                {
                    btnSend.Enabled = false;
                }
            }
        }
Exemplo n.º 10
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            try
            {
                string login_id = string.Empty;
                EncryptedQueryString args = new EncryptedQueryString(Request.QueryString["args"]);
                foreach (var arg in args)
                {
                    Label label = new Label();
                    label.Text = String.Format("{0}={1}", arg.Key, HttpUtility.HtmlEncode(arg.Value));
                    login_id = label.Text;
                }
                if (login_id == "")
                {
                    throw new Exception("Invalid User!");
                }
                string[] b = login_id.Split('=');
                login_id = b[1];
                using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext())
                {
                    var account = (from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == login_id select a).FirstOrDefault();
                    account.ActivationStatus_Mail = 1;
                    dataDB.SubmitChanges();
                    lbResponse.Text = "Your Account activated successfully!";
                }
            }
            catch (Exception ex)
            {
                lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000");
                lbResponse.Text = ex.Message;

            }

        }
    }
Exemplo n.º 11
0
    protected void Save_Click(object sender, ImageClickEventArgs e)
    {
        //Response.Write(Request.Form["test"]);
        Person user = (Person)Session["User"];
        PeriodDB perdb = new PeriodDB();
        Period per = perdb.getPeriod(Convert.ToInt32(this.month), Convert.ToInt32(this.year));

        if (this.employees != null)
        {

            DepartmentList department_list = new DepartmentList();
            List<Department> departments = department_list.getDepartments(employees);

            foreach (Department dep in departments)
            {
                EmployeeList emp_list = new EmployeeList();
                List<Employee> emps = null;//// emp_list.getEmployeesOfDepartment(dep.DepartmentID, employees);
                EmployeeComparerByPostASC cmpByPostASC = new EmployeeComparerByPostASC();
                emps.Sort(cmpByPostASC);
                foreach (Employee em in emps)
                {
                    EmployeeList emplist = new EmployeeList();
                    List<TimekeeperHours> current = null;//emplist.getEmployeesTimekeeperHours(em);
                    List<HRHours> hr_current = null;/// emplist.getEmployeesHRHours(em);

                    for (int i = 1; i <= count_days; i++)
                    {
                        string textbox_id = "tb" + dep.DepartmentID + em.PostID + em.EmployeeID + i.ToString();
                        //string hr_id = "hr" + dep.DepartmentID + em.EmployeeID + i.ToString();

                        Date dt = new Date();
                        SQLDB db = new SQLDB();

                        string hour = Request.Form[textbox_id];
                        //string overhour = Request.Form[hr_id];

                        TimekeeperHours th = current.Find(delegate(TimekeeperHours ht) { return ht.Day == i.ToString(); });

                        decimal h = -1;
                        string sym = "";

                        if ((hour != "") && (hour != null))
                        {
                            if (HasSymbols(hour))
                            {
                                if (th == null)
                                    db.insertTimekeeperHoursAndSymbols(em.EmployeeID, em.StartPeriod, em.BeginDate, em.EndDate, h, hour, user.TabNum, dep.DepartmentID, em.PostID, i.ToString(), month, year, per.PeriodID);
                                else
                                    if (!th.Symbols.Equals(hour))
                                        db.updateTimekeeperHoursAndSymbols(user.TabNum, h, hour, th.ID);
                            }
                            else
                            {
                                h = Convert.ToDecimal(hour);

                                if (th == null)
                                    db.insertTimekeeperHoursAndSymbols(em.EmployeeID, em.StartPeriod, em.BeginDate, em.EndDate, h, sym, user.TabNum, dep.DepartmentID, em.PostID, i.ToString(), month, year, per.PeriodID);
                                else
                                    if (th.Hours != h)
                                        db.updateTimekeeperHoursAndSymbols(user.TabNum, h, sym, th.ID);
                            }
                        }

                        if ((hour == "") && (th != null)) db.deleteTimekeeperHours(th.ID);

                    }
                }

            }
        }

        EncryptedQueryString QueryString = new EncryptedQueryString();
        QueryString.Add("month", period.SelectedItem.Value);
        QueryString.Add("role", role);
        //Server.Transfer("TimeTable.aspx?data=" + QueryString.ToString());
        //Response.Redirect("Tabel.aspx?data=" + QueryString.ToString());
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) Response.Redirect("Default.aspx");

        Date dt = new Date();
        SAPDB db = new SAPDB();
        SQLDB sql = new SQLDB();
        PeriodDB perdb = new PeriodDB();
        Person user = (Person)Session["User"];

        string role = "";
        string month_id = "";
        string year = "";
        string start_date = "";
        string end_date = "";

        if (Request.QueryString["rft"] != null)
        {
            EncryptedQueryString QueryString = new EncryptedQueryString(Request.QueryString["rft"]);
            if (QueryString["role"] != null) role = QueryString["role"].ToString();
            if (QueryString["month_id"] != null) month_id = QueryString["month_id"].ToString();
            if (QueryString["year"] != null) year = QueryString["year"].ToString();
            if (QueryString["start_date"] != null) start_date = QueryString["start_date"].ToString();
            if (QueryString["end_date"] != null) end_date = QueryString["end_date"].ToString();
        }

        Period per = perdb.getPeriod(Convert.ToInt32(month_id), Convert.ToInt32(year));

        EmployeeList emp_list = new EmployeeList();

        List<Employee> all_employees = db.getEmployeeListForReports(start_date, end_date, user.TabNum, role);

        if (all_employees == null)
        {
            MessageBox.Show("Невозможно сформировать отчет! Список сотрудников за период пуст!");
            return;
        }

        EmployeeComparerByFullnameASC emp_comp = new EmployeeComparerByFullnameASC();
        all_employees.Sort(emp_comp);

        Response.Clear();
        Response.Charset = "utf-8";
        Response.ContentType = "application/vnd.ms-excel";

        string str = @"<table cellspacing='0' cellpadding='0' border='1'>
                            <tr>
                                <td colspan='25' style='border: 0px; height: 30px; font-weight: bold;' align='center' valign='middle'>
                                    ОТЧЕТ
                                </td>
            <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan='25' style='border: 0px; height: 30px;' align='center' valign='middle'>";
        str += "по фактически отработанному времени за " + per.MonthName.ToUpper() + " " + per.Year + " года</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";

        str += @"<tr>
                    <td rowspan='2' style='background-color: #99CCFF; font-weight: bold;' align='center'>
                            Таб. номер
                    </td>
                     <td rowspan='2' style='background-color: #99CCFF; font-weight: bold;' align='center'>
                            ФИО
                    </td>
                     <td rowspan='2' style='width:80px; background-color: #99CCFF; font-weight: bold;' align='center'>
                            Кол-во рабочих часов по графику (норма)
                    </td>
                    <td colspan='20' style='height: 30px;  background-color: #99CCFF; font-weight: bold;' align='center'>
                          ОТКЛОНЕНИЯ
                    </td>
                    <td rowspan='2' style='width:80px; background-color: #99CCFF; font-weight: bold;' align='center'>
                            Итого отработано часов за период (факт)
                    </td>
                     <td rowspan='2' style='width:80px; background-color: #99CCFF; font-weight: bold;' align='center'>
                            Итого отработано сверурочных часов
                    </td>
        <td rowspan='2'>&nbsp;</td><td rowspan='2'>&nbsp;</td><td rowspan='2'>&nbsp;</td>
                </tr>
                <tr>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Временная нетрудоспособность
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Выходные дни (еженедельный отпуск) и нерабочие праздничные дни
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Время простоя по вине работника
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Невыходы на время исполнения государственных или общественных обязанностей согласно законодательству
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Отпуск без сохранения заработной платы, предоставляемый работнику по разрешению работодателя
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Служебная командировка
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Неявки по невыясненным причинам (до выяснения обстоятельств)
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Время простоя по причинам, не зависящим от работодателя и работника
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Дополнительные выходные дни (оплачиваемые)
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Ежегодный дополнительный оплачиваемый отпуск
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Отпуск по уходу за ребенком до достижения им возраста трех лет
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Отпуск без сохранения заработной платы при условиях, предусмотренных действующим законодательством Российской Федерации
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Ежегодный основной оплачиваемый отпуск
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Повышение квалификации с отрывом от работы
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Прогулы (отсутствие на рабочем месте без уважительных причин в течение времени, установленного законодательством)
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Отпуск по беременности и родам (отпуск в связи с усыновлением новорожденного ребенка)
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Время простоя по вине работодателя
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Дополнительный отпуск в связи с обучением с сохранением среднего заработка работникам, совмещающим работу с обучением
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Дополнительный отпуск в связи с обучением без сохранения заработной платы
                    </td>
                    <td style='width:80px; background-color: #FFFF99; font-weight: bold;' align='center'>
                            Работа в выходные и праздничные дни
                    </td>

                </tr>
                ";

        foreach(Employee emp in all_employees)
        {
            decimal norma = 0;
            decimal overhours = 0;
            decimal def_sum = 0;

            Deflections d = new Deflections();

            List<HRHours> hr_current = sql.getHRHours(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);
            List<Schedule> schedule = sql.getSchedule(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);
            List<ScheduleDeflection> dschedule = sql.getScheduleDeflection(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);

            foreach (Schedule sch in schedule)
            {
                // если выходной или изменение на выходной то пишем в отклонения по выходному дню
                if (((sch.DaySchedule == "FREE") && (Convert.ToInt32(sch.TimeHours) == 0)) || (sch.DayScheduleVar == "F"))
                    d.def_V += sch.TimeHours;
                else
                    norma += sch.TimeHours;
            }

            foreach (HRHours over in hr_current)
                overhours += (over.DayOverHours + over.NightOverHours);

            foreach (ScheduleDeflection sdf in dschedule)
            {

                def_sum += sdf.TimeHours;

                if (sdf.CodeT13.Equals("РВ"))
                {
                    def_sum -= sdf.TimeHours;       // убираем из поля Итого отработано по факту
                    overhours += sdf.TimeHours;          // записываем в поле Итого сверхурочных часов
                }

                switch (sdf.CodeT13)
                {
                    case "Б":
                        d.def_B += sdf.TimeHours;
                        break;
                    case "ВП":
                        d.def_VP += sdf.TimeHours;
                        break;
                    case "Г":
                        d.def_G += sdf.TimeHours;
                        break;
                    case "ДО":
                        d.def_DO += sdf.TimeHours;
                        break;
                    case "К":
                        d.def_K += sdf.TimeHours;
                        break;
                    case "НН":
                        d.def_NN += sdf.TimeHours;
                        break;
                    case "НП":
                        d.def_NP += sdf.TimeHours;
                        break;
                    case "ОВ":
                        d.def_OV += sdf.TimeHours;
                        break;
                    case "ОД":
                        d.def_OD += sdf.TimeHours;
                        break;
                    case "ОЖ":
                        d.def_OJ += sdf.TimeHours;
                        break;
                    case "ОЗ":
                        d.def_OZ += sdf.TimeHours;
                        break;
                    case "ОТ":
                        d.def_OT += sdf.TimeHours;
                        break;
                    case "ПК":
                        d.def_PK += sdf.TimeHours;
                        break;
                    case "ПР":
                        d.def_PR += sdf.TimeHours;
                        break;
                    case "Р":
                        d.def_R += sdf.TimeHours;
                        break;
                    case "РП":
                        d.def_RP += sdf.TimeHours;
                        break;
                    case "У":
                        d.def_U += sdf.TimeHours;
                        break;
                    case "УД":
                        d.def_UD += sdf.TimeHours;
                        break;
                    case "РВ":
                        d.def_RV += sdf.TimeHours;
                        break;
                    default:
                        break;

                }
            }
            str += "<tr>";
            str += "<td align='center'>" + DeleteZeroFromEmployeeID(emp.EmployeeID) + "</td>";
            str += "<td align='center'>" + emp.FullName + "</td>";

            if (norma != 0) str += "<td align='center'>" + norma.ToString() + "</td>";
            else  str += "<td>&nbsp;</td>";

            if (d.def_B != 0) str += "<td align='center'>" + d.def_B.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_V != 0) str += "<td align='center'>" + d.def_V.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_VP != 0) str += "<td align='center'>" + d.def_VP.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_G != 0) str += "<td align='center'>" + d.def_G.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_DO != 0) str += "<td align='center'>" + d.def_DO.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_K != 0) str += "<td align='center'>" + d.def_K.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_NN != 0) str += "<td align='center'>" + d.def_NN.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_NP != 0) str += "<td align='center'>" + d.def_NP.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_OV != 0) str += "<td align='center'>" + d.def_OV.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_OD != 0) str += "<td align='center'>" + d.def_OD.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_OJ != 0) str += "<td align='center'>" + d.def_OJ.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_OZ != 0) str += "<td align='center'>" + d.def_OZ.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_OT != 0) str += "<td align='center'>" + d.def_OT.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_PK != 0) str += "<td align='center'>" + d.def_PK.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_PR != 0) str += "<td align='center'>" + d.def_PR.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_R != 0) str += "<td align='center'>" + d.def_R.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_RP != 0) str += "<td align='center'>" + d.def_RP.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_U != 0) str += "<td align='center'>" + d.def_U.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_UD != 0) str += "<td align='center'>" + d.def_UD.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (d.def_RV != 0) str += "<td align='center'>" + d.def_RV.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if ((norma - def_sum) != 0) str += "<td align='center'>" + (norma - def_sum).ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            if (overhours != 0) str += "<td align='center'>" + overhours.ToString() + "</td>";
            else str += "<td>&nbsp;</td>";

            str += "<td>" + getCompany(emp.Department) + "</td><td>" + getPath(emp.Department) + "</td><td>" + getDepartment(emp.Department) + "</td>";

            str += "</tr>";

            str += "</tr>";

        }

        str += "</table>";

        Response.Write(str);
        Response.End();
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) Response.Redirect("Default.aspx");

        Date dt = new Date();
        SAPDB db = new SAPDB();
        SQLDB sql = new SQLDB();
        PeriodDB perdb = new PeriodDB();
        NightHoursDB nightdb = new NightHoursDB();
        Person user = (Person)Session["User"];

        string role = "";
        string month_id = "";
        string year = "";
        string start_date = "";
        string end_date = "";

        if (Request.QueryString["rtb"] != null)
        {
            EncryptedQueryString QueryString = new EncryptedQueryString(Request.QueryString["rtb"]);
            if (QueryString["role"] != null) role = QueryString["role"].ToString();
            if (QueryString["month_id"] != null) month_id = QueryString["month_id"].ToString();
            if (QueryString["year"] != null) year = QueryString["year"].ToString();
            if (QueryString["start_date"] != null) start_date = QueryString["start_date"].ToString();
            if (QueryString["end_date"] != null) end_date = QueryString["end_date"].ToString();
        }

        List<NightHours> nighthours = nightdb.getNightHours();

        Period per = perdb.getPeriod(Convert.ToInt32(month_id), Convert.ToInt32(year));

        EmployeeList emp_list = new EmployeeList();

        List<Employee> all_employees = db.getEmployeeListForReports(start_date, end_date, user.TabNum, role);

        if (all_employees == null)
        {
            MessageBox.Show("Невозможно сформировать отчет! Список сотрудников за период пуст!");
            return;
        }

        EmployeeComparerByFullnameASC emp_comp = new EmployeeComparerByFullnameASC();
        all_employees.Sort(emp_comp);

        Response.Clear();
        Response.Charset = "utf-8";
        Response.ContentType = "application/vnd.ms-excel";

        string str = @"<table cellspacing='0' cellpadding='0' border='1'>
                            <tr>
                                <td width='30px' style='font-weight: bold;' align='center' valign='middle'>
                                    Таб. номер
                                </td>
                                <td width='100px' style='font-weight: bold;' align='center' valign='middle'>
                                    ФИО
                                </td>";

        int count_days = dt.getCountDays(per.MonthID, per.Year);

        for (int i = 1; i <= count_days; i++)
            str += "<td width='20px' style='font-weight: bold;' align='center'>" + i.ToString() + "</td><td width='20px' style='background-color: #99CCFF; font-weight: bold;' align='center' >" + i.ToString() + "a</td>";

        str += "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";

        foreach (Employee emp in all_employees)
        {

            str += "<tr>";
            str += "<td width='30px' align='center'>" + DeleteZeroFromEmployeeID(emp.EmployeeID) + "</td>";
            str += "<td width='100px' align='center'>" + emp.FullName + "</td>";

            int day = 1;

            List<HRHours> hr_current = sql.getHRHours(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);
            List<Schedule> schedule = sql.getSchedule(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);
            List<ScheduleDeflection> dschedule = sql.getScheduleDeflection(emp.EmployeeID, emp.StartPeriod, emp.BeginDate, emp.EndDate);

           foreach (Schedule sch in schedule)
           {

               decimal all_hours = 0;
               decimal night_hours = 0;

               int d = Convert.ToInt32(sch.DayPeriod);
               // если у нас день не совпадает с днем в графике, заполняю пустым квадратом

               //TimekeeperHours tkh = tkh_current.Find(delegate(TimekeeperHours h) { return Convert.ToInt32(h.Day) == day; });
               HRHours hr = hr_current.Find(delegate(HRHours hrh) { return Convert.ToInt32(hrh.Day) == day; });

               if (hr != null)
               {
                   all_hours += hr.DayOverHours + hr.NightOverHours;
                   night_hours += hr.NightOverHours;
               }

               while (d != day)
               {
                   if (day == count_days) break;

                   if (all_hours != 0) str += "<td width='20px' align='center'>" + all_hours.ToString() + "</td>";
                   else str += "<td width='20px' align='center'>&nbsp;</td>";

                   if (night_hours != 0) str += "<td width='20px' style='background-color: #99CCFF;' align='center'>" + night_hours.ToString() + "</td>";
                   else str += "<td width='20px' style='background-color: #99CCFF;' align='center'>&nbsp;</td>";

                   day++;
               }

               ScheduleDeflection sd = dschedule.Find(delegate(ScheduleDeflection dsch) { return Convert.ToInt32(dsch.DayPeriod) == day; });
               if (sd != null)
               {
                   //time = CheckDecimalNumber(sd.CodeT13);

                   decimal diversity = sch.TimeHours - sd.TimeHours;
                   if (diversity != 0)
                   {
                       if (diversity > 0)
                       {

                           all_hours = diversity;
                       }
                       else
                       {

                           all_hours = sd.TimeHours;
                       }
                   }

                   if (all_hours != 0) str += "<td width='20px' align='center'>" + all_hours.ToString() + "</td>";
                   else str += "<td width='20px' align='center'>&nbsp;</td>";

                   if (night_hours != 0) str += "<td width='20px' style='background-color: #99CCFF;' align='center'>" + night_hours.ToString() + "</td>";
                   else str += "<td width='20px' style='background-color: #99CCFF;' align='center'>&nbsp;</td>";
               }
               else
               {

                   // если выходной или изменение на выходной то пишем в отклонения по выходному дню
                   if (((sch.DaySchedule == "FREE") && (Convert.ToInt32(sch.TimeHours) == 0)) || (sch.DayScheduleVar == "F"))
                   {
                       if (all_hours != 0) str += "<td width='20px' align='center'>" + all_hours.ToString() + "</td>";
                       else str += "<td width='20px' align='center'>&nbsp;</td>";

                       if (night_hours != 0) str += "<td width='20px' style='background-color: #99CCFF;' align='center'>" + night_hours.ToString() + "</td>";
                       else str += "<td width='20px' style='background-color: #99CCFF;' align='center'>&nbsp;</td>";
                   }
                   else
                   {
                       //decimal hour_start = Convert.ToInt32(sch.TimeBegin.Substring(0, 2));
                       //decimal hour_end = Convert.ToInt32(sch.TimeEnd.Substring(0, 2));
                       //decimal minute_start = Convert.ToDecimal(sch.TimeBegin.Substring(2, 2));
                       //decimal minute_end = Convert.ToDecimal(sch.TimeEnd.Substring(2, 2));

                       //if (hour_start == 0) hour_start = 24;
                       //if (hour_end == 0) hour_end = 24;\
                       /*
                       hour_start += minute_start / 60;
                       hour_end += minute_end / 60;

                       if (sch.TimeHours != 0)
                       {
                           if ((hour_start > 6) && (hour_end < 22))
                               all_hours += sch.TimeHours;
                           if (hour_start <= 6)
                           {
                               night_hours += 6 - hour_start - 1;
                               all_hours += sch.TimeHours;
                           }
                           if (hour_end >= 22)
                           {
                               night_hours += hour_end - 22;
                               all_hours += sch.TimeHours;
                           }
                       }
                       */

                       all_hours += sch.TimeHours;

                       NightHours nhour = nighthours.Find(delegate(NightHours nh) { return nh.DaySchedule.ToUpper() == sch.DaySchedule.ToUpper(); });

                       if (nhour != null)
                       {
                           night_hours += nhour.Night_Hours;
                       }

                       //day_hours += (night_hours + sch.TimeHours);
                       if (all_hours != 0) str += "<td width='20px' align='center'>" + all_hours.ToString() + "</td>";
                       else str += "<td width='20px' align='center'>&nbsp;</td>";

                       if (night_hours != 0) str += "<td width='20px' style='background-color: #99CCFF;' align='center'>" + night_hours.ToString() + "</td>";
                       else str += "<td width='20px' style='background-color: #99CCFF;' align='center'>&nbsp;</td>";
                   }
               }

               day++;
           }

           while (day <= count_days)
           {
               decimal all_hours = 0;
               decimal night_hours = 0;

               //HRHours hr = hr_current.Find(delegate(HRHours hrh) { return Convert.ToInt32(hrh.Day) == day; });

               if (all_hours != 0) str += "<td width='20px' align='center'>" + all_hours.ToString() + "</td>";
               else str += "<td width='20px' align='center'>&nbsp;</td>";

               if (night_hours != 0) str += "<td width='20px' style='background-color: #99CCFF;' align='center'>" + night_hours.ToString() + "</td>";
               else str += "<td width='20px' style='background-color: #99CCFF;' align='center'>&nbsp;</td>";

               day++;
           }

           str += "<td>" + getCompany(emp.Department) + "</td><td>" + getPath(emp.Department) + "</td><td>" + getDepartment(emp.Department) + "</td>";

           str += "</tr>";

        }

        str += "</table>";

        Response.Write(str);
        Response.End();
    }
Exemplo n.º 14
0
        protected void btnSend_Click(object sender, EventArgs e)
        {
            string errorMessage = string.Empty;

            try
            {
                var args = new EncryptedQueryString(Request.QueryString["args"]);
                _childid     = args["CHILDID"];
                _childname   = args["CHILDNAME"];
                _sponsorid   = args["SPONSORID"];
                _sponsorname = args["SPONSORNAME"];

                string customMessage = txtMessage.Text.Replace("\r\n", "<br />");

                StringBuilder message = new StringBuilder();
                message.AppendLine("<table>");
                message.AppendLine(string.Format("<tr><td>Sponsor ID:</td><td>{0}</td></tr>", _sponsorid));
                message.AppendLine(string.Format("<tr><td>Sponsor Name:</td><td>{0}</td></tr>", _sponsorname));
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine(string.Format("<tr><td>Child ID:</td><td>{0}</td></tr>", _childid));
                message.AppendLine(string.Format("<tr><td>Child Name:</td><td>{0}</td></tr>", _childname));
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine(string.Format("<tr><td colspan='2'>{0}</td></tr>", customMessage));
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine(string.Format("<tr><td colspan='2'>{0}</td></tr>", MyContent.LinkHtml));
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine("<tr><td colspan='2'><br /></td></tr>");
                message.AppendLine("</table>");

                var template = new EmailTemplate(MyContent.TemplateID);

                var em = new EMail(template);
                em.Save();
                em.FromAddress     = MyContent.FromAddress;
                em.FromDisplayName = MyContent.FromName;
                em.Subject         = MyContent.SubjectLine;
                em.ContentHTML     = message.ToString();

                em.Send(MyContent.ToAddress, MyContent.ToAddress, API.Users.CurrentUser.RaisersEdgeID, API.Users.CurrentUser.UserID, null, this.Page);
            }
            catch (ArgumentNullException ane)
            {
                errorMessage = ane.Message;
            }
            catch (Exception ex)
            {
                errorMessage = "An error has occurred, please try again.";
                Blackbaud.Web.Content.Core.Common.LogErrorToDB(ex, false);
            }

            if (!string.IsNullOrWhiteSpace(errorMessage))
            {
                Utility.RedirectToBBISPage(MyContent.ErrorPageID);
            }
            else
            {
                Utility.RedirectToBBISPage(MyContent.SuccessPageID);
            }
        }
Exemplo n.º 15
0
        public ActionResult SendRegisterConfirmEmail(RegisterModel registerModel, int parentEmailTemplateNodeId, int emailTemplateNodeId)
        {
            var errorMsg = "registration failed !!!";

            if (umbraco.library.GetDictionaryItem("") != null)
            {
                if (umbraco.library.GetDictionaryItem("") != "")
                {
                    errorMsg = umbraco.library.GetDictionaryItem("");
                }
            }
            try
            {
                var parentEmailTemplate = contentService.GetById(parentEmailTemplateNodeId);

                var fromEmail  = parentEmailTemplate.Properties["fromEmail"].Value.ToString();
                var bccEmail   = parentEmailTemplate.Properties["bCCEmail"].Value.ToString();
                var adminEmail = parentEmailTemplate.Properties["adminEmail"].Value.ToString();


                var emailTemplate = contentService.GetById(emailTemplateNodeId);
                var subject       = emailTemplate.Properties["subject"].Value.ToString();
                var mailBody      = emailTemplate.Properties["mailBody"].Value.ToString();

                mailBody.Replace("#email#", registerModel.Email);

                var isSuccess = new SendMail().Send(fromEmail, adminEmail, bccEmail, subject, mailBody);

                if (isSuccess)
                {
                    var successMsg = "registration is approved";
                    if (umbraco.library.GetDictionaryItem("") != null)
                    {
                        if (umbraco.library.GetDictionaryItem("") != "")
                        {
                            successMsg = umbraco.library.GetDictionaryItem("");
                        }
                    }
                    if (emailTemplate.Properties["sendToVisitor"].Value.ToString() == "1")
                    {
                        var CompleteRegisterUrl = Request.Url.Host;
                        var encryptedMail       = new EncryptedQueryString();
                        encryptedMail["EM"] = registerModel.Email;
                        var visitorSubject = emailTemplate.Properties["subjectToVisitor"].Value.ToString();
                        var visitorMail    = emailTemplate.Properties["mailToVisitor"].Value.ToString();
                        visitorMail = visitorMail.Replace("#email#", registerModel.Email).Replace("#CompleteRegisterUrl#", CompleteRegisterUrl + "/register/register-confirm?" + "email=" + encryptedMail).Replace("#username#", registerModel.LoginName);

                        var isMailSend = new SendMail().Send(fromEmail, registerModel.Email, bccEmail, visitorSubject, visitorMail);
                        if (isMailSend)
                        {
                            return(Json(new { result = "success", message = successMsg }));
                        }
                    }
                }
                return(Json(new { result = "fail", message = errorMsg }));
            }
            catch (Exception ex)
            {
                Helper.CreateErrorLogMessage(ex.Message + "with inner exception '" + ex.InnerException + "'");
                return(Json(new { result = "fail", message = errorMsg }));
            }
        }
Exemplo n.º 16
0
 protected void bt_filter_tab_Click(object sender, EventArgs e)
 {
     EncryptedQueryString QueryString = new EncryptedQueryString();
     QueryString.Add("tab", filter_tab_text.Text);
     QueryString.Add("month", period.SelectedItem.Value);
     QueryString.Add("role", role);
     //Server.Transfer("TimeTable.aspx?data=" + QueryString.ToString(`));
     Response.Redirect("Tabel.aspx?data=" + QueryString.ToString());
 }
Exemplo n.º 17
0
 protected void Check_Click(object sender, ImageClickEventArgs e)
 {
     EncryptedQueryString QueryString = new EncryptedQueryString();
     QueryString.Add("month", period.SelectedItem.Value);
     QueryString.Add("role", role);
     QueryString.Add("check", "true");
     Response.Redirect("Tabel.aspx?data=" + QueryString.ToString());
 }
Exemplo n.º 18
0
    private void fillMonths()
    {
        if (period.Items.Count != 0) return;

        Date dt = new Date();
        List<Period> periods = dt.getPeriodsToDropDownList();
        string monthID = "";
        foreach (Period p in periods)
        {
            monthID = p.MonthID.ToString();
            if (monthID.Length == 1) monthID = monthID.Insert(0, "0");
            ListItem li = new ListItem(p.MonthName.ToUpper(), monthID);
            period.Items.Add(li);
        }

        //Response.Write("fillMonths<br>");

        if (Request.QueryString["data"] != null)
        {
            EncryptedQueryString QueryString = new EncryptedQueryString(Request.QueryString["data"]);
            foreach (string key in QueryString.Keys)
                if (key == "month") period.SelectedValue = QueryString[key];
        }
    }
Exemplo n.º 19
0
    protected void ddl_post_SelectedIndexChanged(object sender, EventArgs e)
    {
        EncryptedQueryString QueryString = new EncryptedQueryString();
        QueryString.Add("post", ddl_post.SelectedItem.Value);
        QueryString.Add("month", period.SelectedItem.Value);
        QueryString.Add("role", role);
        //Server.Transfer("TimeTable.aspx?data=" + QueryString.ToString());

        Response.Redirect("Tabel.aspx?data=" + QueryString.ToString());
    }
Exemplo n.º 20
0
 protected void RefreshPage()
 {
     EncryptedQueryString QueryString = new EncryptedQueryString();
     QueryString.Add("month", period.SelectedItem.Value);
     QueryString.Add("role", role);
     //Server.Transfer("TimeTable.aspx?data=" + QueryString.ToString());
     Response.Redirect("Tabel.aspx?data=" + QueryString.ToString());
 }
Exemplo n.º 21
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["User"] == null) Response.Redirect("Default.aspx");

        Display disp = new Display();
        Date dt = new Date();
        SAPDB db = new SAPDB();
        SQLDB sql = new SQLDB();
        PeriodDB perdb = new PeriodDB();

        Person user = (Person)Session["User"];

        //List<Role> rol = user.Roles;
        //foreach (Role r in rol)
        //    Response.Write(r.RoleID + " = " + r.RoleName);

        if (!IsPostBack)
        {
            fillMonths();
            if (Request.QueryString["data"] == null)
                period.SelectedValue = dt.getMonthToday();
        }

        year = period.SelectedItem.Text.Substring(period.SelectedItem.Text.Length - 4);
        month = period.SelectedItem.Value;

        string fio = "";
        string tab_number = "";
        string post = "";
        check = false;
        closed = false;

        count_days = dt.getCountDays(Convert.ToInt32(month), Convert.ToInt32(year));

        if (Request.QueryString["type"] != null) role = Request.QueryString["type"].ToString();

        Period per = perdb.getPeriod(Convert.ToInt32(month), Convert.ToInt32(year));

        if (per.IsClosed == 1)
        {
            lbStatus.Text = "������";
            Traffic.Text = "<img alt='' src='App_Resources/red.bmp' style='position:relative; top:4px;' />";
            closed = true;
        }
        else Traffic.Text = "<img alt='' src='App_Resources/green.bmp' style='position:relative; top:4px;' />";

        if (Request.QueryString["data"] != null)
        {
            EncryptedQueryString QueryString = new EncryptedQueryString(Request.QueryString["data"]);
            if (QueryString["fio"] != null) fio = QueryString["fio"];
            if (QueryString["tab"] != null) tab_number = QueryString["tab"];
            if (QueryString["post"] != null) post = QueryString["post"];
            if (QueryString["role"] != null) role = QueryString["role"];
            if (QueryString["check"] != null) check = true;
            if (!QueryString["month"].Equals(period.SelectedItem.Value))
            {
                fio = "";
                tab_number = "";
                post = "";
                check = false;
            }
        }

        //Response.Write(month);

        //Response.Write("fio=" + fio + "tab=" + tab_number + " - " + month + "<br>");
        //Response.Write(post + "<br>");

        string start_date = dt.getSAPStartPeriodDate(month, year);
        string end_date = dt.getSAPEndPeriodDate(month, year);

        StartDateOfPeriod = start_date;
        EndDateOfPeriod = end_date;
        //Response.Write(start_date + end_date);

        Label lb = new Label();
        lb.Text = disp.DisplayDaysTabel(count_days, 18);
        days.Controls.Add(lb);

        //Response.Write(start_date + end_date);
        //Period period_time = perdb.getPeriod(Convert.ToInt32(month), Convert.ToInt32(year));

        setButtons(role);

        //Response.Write(start_date + "-" + end_date + "<br>");

        this.employees = null;/// db.getEmployeeList(start_date, end_date, user.TabNum, this.role);
        EmployeeList emp_list = new EmployeeList();
        List<Post> post_list = null;/// pl.getPosts(db.getPostList(start_date, end_date, user.TabNum, this.role));
        if (post_list != null)
        {
            fillPosts(post_list);
        }
        else
        {
            ListItem li = new ListItem("�������� ���������");
            ddl_post.Items.Add(li);
        }

        /*if (post != "")
        {
            if (post != "���")
            {
                EmployeeList empl = new EmployeeList();
               // this.employees = empl.getEmployeesOnCurrentPost(post, employees);

            }
        }

        if (fio != "")
        {
            EmployeeList emp_fio = new EmployeeList();
            this.employees = emp_fio.getEmployeesByFIO(fio, employees);
        }

        if (tab_number != "")
        {
            EmployeeList emp_tab = new EmployeeList();
            this.employees = emp_tab.getEmployeesByTab(tab_number, employees);
        }*/

        if (check)
        {
            EmployeeList emp_check = new EmployeeList();
            /////this.employees = emp_check.getWrongCheckedEmployees(employees, count_days, hours, overhours);
        }

        if (employees != null)
        {

            DepartmentList department_list = new DepartmentList();
            List<Department> departments = department_list.getDepartments(employees);

            foreach (Department dep in departments)
            {

                Label depart = new Label();
                depart.Text = disp.DisplayDepartmentName(dep.DepartmentName, dep.DepartmentID, StartDateOfPeriod);
                content.Controls.Add(depart);

                Label lbEmps = new Label();
                lbEmps.Text = "<div  id='" + dep.DepartmentID + "' style='display:none'>";

                // �������� ���� �������� ��� �������� ��������
                /*EmployeeList emp_list = new EmployeeList();
                List<Employee> emps = emp_list.getEmployeesOfDepartment(dep.DepartmentID, employees);
                EmployeeComparerByPostASC cmpByPostASC = new EmployeeComparerByPostASC();
                emps.Sort(cmpByPostASC);
                //for (int j = 0; j < 100; j++)
                foreach (Employee em in emps)
                {
                    lbEmps.Text += "<table cellpadding='0' cellspacing='0' border='0' class='employee'><tr><td class='main_info_left_no'>&nbsp</td><td class='employee_post'>" + em.Post + "</td><td class='employee_id'>" + em.EmployeeID + "</td><td class='employee_name'><img src='App_Resources/person.gif' style='cursor: hand; cursor: pointer;'>&nbsp<span style='cursor: hand; cursor: pointer;'  onclick='window.open(\"" + getCardUrl(em.EmployeeID) +"\",\"displayWindow\",\"menubar=no,width=800,height=600,resizable=yes,scrollbars=yes\")'>" + em.FullName + "</span></td><td class='employee_grid_line_center'>&nbsp;</td><td>" + disp.DisplaySchedules(count_days, 18, em.EmployeeID, dep.DepartmentID, hours, overhours, em.Schedule, em.ScheduleDeflection, role, check, closed) + "</td><td class='main_info_right_no'></td></tr></table>";

                }*/
                lbEmps.Text += "</div>";
                content.Controls.Add(lbEmps);

            }

        }

        // ajax �� �������� ������ ����������� ������������� �������������
        string cbReference = Page.ClientScript.GetCallbackEventReference(this, "arg", "ClientCallback", "context");
        string func_name = "FillEmployeesCallback";
        string cbScript = "function " + func_name + "(arg, context)" + "{" + cbReference + ";" + "}";
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), func_name, cbScript, true);
    }