Пример #1
0
    protected void ddl_typerequest_SelectedIndexChanged(object sender, EventArgs e)
    {
        Encryption64 e64      = new Encryption64();
        string       nosample = e64.Encrypt(no_samples.ToString());
        string       notest   = e64.Encrypt(no_tests.ToString());
        string       reqid    = e64.Encrypt(process_reqid);

        Response.Redirect("~/UI/users/process_request1.aspx?mode=" + mode + "&user="******"&process_reqid=" + reqid + "&nosample=" + nosample + "&notest=" + notest + "&rtype=" + e64.Encrypt(rtype));
    }
Пример #2
0
    /// <summary>
    /// Requestor able to Edit Request if the request is declined
    /// </summary>
    protected void btn_edit_request_Click(object sender, EventArgs e)
    {
        Encryption64 e64      = new Encryption64();
        string       nosample = e64.Encrypt(req_samples.countSamplesByReqId(reqid).ToString());
        string       notest   = e64.Encrypt(req_tests.countTestsByReqId(reqid).ToString());
        string       rtype    = e64.Encrypt(req_row.reqtype);

        Response.Redirect("~/UI/users/process_request1.aspx?mode=edit&user=requestor&process_reqid=" + e64.Encrypt(reqid) + "&nosample=" + nosample + "&notest=" + notest + "&rtype=" + rtype);
    }
Пример #3
0
    protected void btn_ok_Click(object sender, EventArgs e)
    {
        int          no_samples = Convert.ToInt32(tb_samples.Text);
        int          no_tests   = Convert.ToInt32(tb_tests.Text);
        Encryption64 e64        = new Encryption64();

        Response.Redirect("~/UI/users/request2.aspx?nosample=" + e64.Encrypt(no_samples.ToString()) + "&notest=" + e64.Encrypt(no_tests.ToString()) + "&rtype=" + e64.Encrypt("Pre-formulation Development"));
    }
Пример #4
0
    protected void imgbtn_View_Click(object sender, ImageClickEventArgs e)
    {
        GridViewRow gv_row = (GridViewRow)((sender as ImageButton).NamingContainer);
        long        prjid  = Convert.ToInt64(gv_projects.DataKeys[gv_row.RowIndex].Value);

        Encryption64 e64 = new Encryption64();

        Response.Redirect("~/UI/admin/prj_requests.aspx?prj=" + e64.Encrypt(prjid.ToString()));
    }
Пример #5
0
    private void set_panels()
    {
        pnl_requested.Visible      = false;     //2
        pnl_sendingtolab.Visible   = false;     //3
        pnl_declined.Visible       = false;     //4
        pnl_inlab.Visible          = false;     //5
        pnl_vieweditresult.Visible = false;     //6

        switch (req_row.statusid)
        {
        case 2:
            pnl_requested.Visible = true;
            CollapsiblePanelExtender1.Collapsed = false;
            break;

        case 3:
            pnl_sendingtolab.Visible = true;
            //tb_comment_sendingLab.Text = req_row.receive_cmnt;

            DataTable dt_labs_global = AddColumns_DataTableLabs();
            ViewState["dt_labs"] = dt_labs_global;
            gv_labs.DataSource   = dt_labs_global;
            gv_labs.DataBind();

            break;

        case 4:
            pnl_declined.Visible = true;
            tb_comment4.Text     = req_row.receive_cmnt;
            CollapsiblePanelExtender1.Collapsed = false;
            break;

        case 5:
            pnl_inlab.Visible = true;
            //tb_comment_fromLab.Text = req_row.lab_cmnt;
            Encryption64 e64 = new Encryption64();
            hl_print_lab.NavigateUrl = "~/UI/users/print_doc.aspx?reqid=" + e64.Encrypt(req_row.reqid);
            DataTable dt = labresult.getLabResult_ByJoining(req_row.reqid);
            gv_fill_result.DataSource = dt;
            gv_fill_result.DataBind();
            break;

        case 6:
            pnl_vieweditresult.Visible = true;
            lbl_resultdate.Text        = req_row.resultdate.ToString("dd/MM/yyyy");
            tb_comment_fromResult.Text = req_row.result_cmnt;
            tb_remark_fromResult.Text  = req_row.result_remark;

            DataTable dt_result = labresult.getLabResult_ByJoining(req_row.reqid);
            gv_view_result.DataSource = dt_result;
            gv_view_result.DataBind();
            break;

        default:
            break;
        }
    }
Пример #6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        ds_analytics.requestsRow req_row = ((ds_analytics.requestsRow)ViewState["req_row"]);
        req_row.responsible = ddl_chng_reqto.SelectedValue;
        requests.update_Request(req_row);

        Encryption64 e64 = new Encryption64();

        Response.Redirect("~/UI/admin/prj_requests.aspx?prj=" + e64.Encrypt(req_row.projectid.ToString()));
    }
Пример #7
0
    private void bind_req_header()
    {
        Encryption64 e64 = new Encryption64();

        hl_print_request.NavigateUrl = "~/UI/users/print_request.aspx?reqid=" + e64.Encrypt(reqid);
        hl_pdf_request.NavigateUrl   = "~/UI/users/print_request.aspx?reqid=" + e64.Encrypt(reqid) + "&action=pdf";
        //setting labels and InfoBox
        lbl_requestor.Text = "(Request by- " + m_users.getFullnameByuserid(req_row.reqfrom) + ")";
        ds_analytics.projectsRow prj_row = projects.getProjectByPrjid(req_row.projectid)[0];
        lbl_project.Text      = prj_row.projectname;
        lbl_prj_type.Text     = prj_row.projecttype;
        lbl_prj_category.Text = prj_row.projectcategory;
        lbl_prj_brand.Text    = prj_row.projectbrand;
        lbl_typeanalysis.Text = req_row.analysistype;
        lbl_requestid.Text    = req_row.reqid;
        lbl_lead.Text         = m_users.getFullnameByuserid(req_row.responsible);
        lbl_typerequest.Text  = req_row.reqtype;

        lbl_status.Text = other.getStatustext(req_row.statusid);
        tb_addinfo.Text = req_row.req_cmnt;
    }
Пример #8
0
    protected void gv_reqs_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.CssClass = "row";
            string userid = Convert.ToString(Session["userid"]);

            Encryption64 e64 = new Encryption64();

            HyperLink hl_reqno = ((HyperLink)e.Row.Cells[1].FindControl("hl_reqno"));
            hl_reqno.NavigateUrl = "~/UI/admin/view_request.aspx?re=" + e64.Encrypt(hl_reqno.Text) + "&us=" + e64.Encrypt(userid);

            ImageButton imgBtnPDF = ((ImageButton)e.Row.Cells[0].FindControl("imgBtn_PDF"));
            imgBtnPDF.OnClientClick = "javascript:OpenPDFpopup('" + e64.Encrypt(hl_reqno.Text) + "')";

            e.Row.Cells[2].Text = projects.getProjectNameByProjectID(Convert.ToInt64(e.Row.Cells[2].Text));
            e.Row.Cells[4].Text = m_users.getFullnameByuserid(e.Row.Cells[4].Text);
            e.Row.Cells[5].Text = m_users.getFullnameByuserid(e.Row.Cells[5].Text);
            e.Row.Cells[6].Text = other.getStatustext(Convert.ToInt32(e.Row.Cells[6].Text));
        }
    }
Пример #9
0
    private void do_mail(string req_status)
    {
        string sub = "Analytics: Your Request " + req_row.reqid + " has been " + req_status;
        string from;

        ds_analytics.m_usersRow receiver_row = m_users.getUserByUserid(req_row.responsible)[0];
        if (receiver_row.email != "")
        {
            from = receiver_row.email;
        }
        else
        {
            from = "*****@*****.**";
        }

        WebClient wclient = new WebClient();
        string    url     = HttpContext.Current.Request.Url.AbsoluteUri;

        url = url.Replace("UI/users/reqaction.aspx", "Mailer/reqapprove.htm");
        string pagedata = wclient.DownloadString(url);
        string body     = pagedata;

        //mail to requestor
        ds_analytics.m_usersRow requestor_row = m_users.getUserByUserid(req_row.reqfrom)[0];
        if (requestor_row != null && requestor_row.email != "")
        {
            //1. Creating login page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            int    len      = url.IndexOf("UI");
            string base_url = url.Substring(0, len);
            base_url = base_url + "Default.aspx?login="******"&redirect=";
            //2. Creating request page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            len = url.IndexOf("reqaction");
            string       redirect_url = url.Substring(0, len);
            Encryption64 e64          = new Encryption64();
            redirect_url = redirect_url + "reqaction_byme.aspx?reqid=" + e64.Encrypt(req_row.reqid);
            //3. Adding login + redirect link
            string web_link = "<a href='" + base_url + redirect_url + "' target='_blank'>Open Request</a>";
            body = body.Replace("!!~requestor_name~!!", requestor_row.fullname);
            body = body.Replace("!!~req_no~!!", req_row.reqid);
            body = body.Replace("!!~req_decision~!!", req_status);
            body = body.Replace("!!~receiver_name~!!", receiver_row.fullname);
            body = body.Replace("!!~You can open the request at web_link~!!", "You can open the request at " + web_link);

            string[]      to       = { requestor_row.email };
            string[]      cc       = new string[2];
            string[]      bcc      = new string[2];
            analyticsmail ana_mail = new analyticsmail();
            ana_mail.sendmails(to, cc, bcc, from, sub, body, "");
        }
    }
Пример #10
0
    /// <summary>
    /// Encrypt query strings from string array.
    /// </summary>
    /// <param name="unencryptedStrings">Unencrypted query strings in the format 'param=value'.</param>
    /// <param name="key">Key, being used to encrypt.</param>
    /// <returns></returns>
    public static string EncryptQueryStrings(string[] unencryptedStrings, string key)
    {
        StringBuilder strings = new StringBuilder();

        foreach (string unencryptedString in unencryptedStrings)
        {
            if (strings.Length > 0)
            {
                strings.Append("&");
            }
            strings.Append(unencryptedString);
        }

        return(string.Concat("request=", Encryption64.Encrypt(strings.ToString(), key)));
    }
Пример #11
0
    /// <summary>
    /// Encrypt query strings from name value collection.
    /// </summary>
    /// <param name="unencryptedStrings">Unencrypted query strings.</param>
    /// <param name="key">Key, being used to encrypt.</param>
    /// <returns></returns>
    public static string EncryptQueryStrings(NameValueCollection unencryptedStrings, string key)
    {
        StringBuilder strings = new StringBuilder();

        foreach (string stringKey in unencryptedStrings.Keys)
        {
            if (strings.Length > 0)
            {
                strings.Append("&");
            }
            strings.Append(string.Format("{0}={1}", stringKey, unencryptedStrings[stringKey]));
        }

        return(string.Concat("request=", Encryption64.Encrypt(strings.ToString(), key)));
    }
        public override AdministradorDTO Salvar(AdministradorDTO entradaDTO, Guid id = default)
        {
            var senhaAleatoria = Usuario.SenhaAleatoria();

            if (entradaDTO.Id == Guid.Empty)
            {
                entradaDTO.Senha = Encryption64.Encrypt(senhaAleatoria);
            }

            var dto = base.Salvar(entradaDTO, id);

            if (id == default && dto?.Id != Guid.Empty)
            {
                _emailSenhaNovoUsuarioServicoAplicacao.Enviar(dto.Email, dto.Nome, senhaAleatoria);
            }

            return(dto);
        }
Пример #13
0
    protected void gv_requests_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.CssClass = "row";

            //From
            e.Row.Cells[5].Text = m_users.getFullnameByuserid(e.Row.Cells[5].Text);
            //To
            e.Row.Cells[6].Text = m_users.getFullnameByuserid(e.Row.Cells[6].Text);
            //Status
            e.Row.Cells[8].Text = other.getStatustext(Convert.ToInt32(e.Row.Cells[8].Text));
            //View Request
            string req_id = Convert.ToString(gv_requests.DataKeys[e.Row.RowIndex].Value);
            string userid = Convert.ToString(Session["userid"]);

            Encryption64 e64 = new Encryption64();
            string       url = "view_request.aspx?re=" + e64.Encrypt(req_id.ToString()) + "&us=" + e64.Encrypt(userid);

            ImageButton ib_view = ((ImageButton)e.Row.FindControl("imgbtn_View"));
            ib_view.Attributes.Add("onclick", "javascript:window.open('" + url + "');");
        }
    }
Пример #14
0
    private void do_mail(string mode, string submitted_reqid)
    {
        ds_analytics.requestsDataTable req_dt            = requests.getRequestbyReqid(submitted_reqid);
        ds_analytics.requestsRow       submitted_req_row = req_dt[0];
        ds_analytics.m_usersRow        requestor_row     = m_users.getUserByUserid(submitted_req_row.reqfrom)[0];
        string sub = "";

        if (mode == "edit")
        {
            sub = "Analytics: Request " + submitted_req_row.reqid + " resubmitted by " + requestor_row.fullname;
        }
        else if (mode == "copy")
        {
            sub = "Analytics: New Request " + submitted_req_row.reqid + " raised by " + requestor_row.fullname;
        }

        string from;

        if (requestor_row.email != "")
        {
            from = requestor_row.email;
        }
        else
        {
            from = "*****@*****.**";
        }

        WebClient wclient = new WebClient();
        string    url     = HttpContext.Current.Request.Url.AbsoluteUri;

        url = url.Replace("UI/users/process_request1.aspx", "Mailer/reqsubmit.htm");
        string pagedata = wclient.DownloadString(url);
        string body     = pagedata;

        //mail to receiver
        ds_analytics.m_usersRow rec_row = m_users.getUserByUserid(ddl_lead.SelectedValue)[0];
        if (rec_row != null && rec_row.email != "")
        {
            //1. Creating login page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            int    len      = url.IndexOf("UI");
            string base_url = url.Substring(0, len);
            base_url = base_url + "Default.aspx?login="******"&redirect=";
            //2. Creating request page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            len = url.IndexOf("process_request1");
            string       redirect_url = url.Substring(0, len);
            Encryption64 e64          = new Encryption64();
            redirect_url = redirect_url + "reqaction.aspx?reqid=" + e64.Encrypt(submitted_req_row.reqid);
            //3. Adding login + redirect link
            string web_link = "<a href='" + base_url + redirect_url + "' target='_blank'>Open Request</a>";
            body = body.Replace("!!~receiver_name~!!", rec_row.fullname);
            body = body.Replace("!!~no_samples~!!", no_samples.ToString());
            body = body.Replace("!!~requestor_name~!!", requestor_row.fullname);
            body = body.Replace("!!~You can open the request at web_link~!!", "You can open the request at " + web_link);

            string[]      to       = { rec_row.email };
            string[]      cc       = new string[2];
            string[]      bcc      = new string[2];
            analyticsmail ana_mail = new analyticsmail();
            ana_mail.sendmails(to, cc, bcc, from, sub, body, "");
        }
    }
Пример #15
0
    protected void gv_req_to_me_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Encryption64 e64 = new Encryption64();

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //set url
            DataKey key      = gv_req_to_me.DataKeys[e.Row.RowIndex];
            string  reqid    = key.Value.ToString();
            string  url      = string.Empty;
            string  statusid = e.Row.Cells[5].Text;
            if (statusid == "1")
            {
                //Requesting
                e.Row.Attributes.Add("ondblclick", "alert('Request is not submitted.')");
            }
            else if (statusid == "2")
            {
                //Requested
                url = "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "3")
            {
                //Approved
                url = "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "4")
            {
                //Declined
                url = "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "5")
            {
                //Lab
                url = "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "6")
            {
                //Result
                url = "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "7")
            {
                //Cancelled
                e.Row.Attributes.Add("ondblclick", "alert('Request has been cancelled.')");
            }

            //onclick
            if (url != string.Empty)
            {
                e.Row.Attributes.Add("ondblclick", "transferLink('" + url + "')");
            }

            //css
            e.Row.CssClass = "row";
            //fullname
            e.Row.Cells[3].Text = m_users.getFullnameByuserid(e.Row.Cells[3].Text);
            //date
            e.Row.Cells[4].Text = Convert.ToDateTime(e.Row.Cells[4].Text).ToString("dd/MMM/yy hh:mm tt");
            //status must be set in the end
            e.Row.Cells[5].Text = other.getStatustext(Convert.ToInt32(e.Row.Cells[5].Text));
        }
    }
        public List<HotelRateAndAvailabilityExt> GetHotelRoomsList()
        {
            List<HotelRateAndAvailabilityExt> HotelRoomsList = new List<HotelRateAndAvailabilityExt>();

            if (HotelRooms.Rows.Count > 0)
            {
                foreach (DataRow dr in HotelRooms.Rows)
                {
                    HotelRateAndAvailabilityExt HotelRoomsObj = new HotelRateAndAvailabilityExt();
                    HotelRoomsObj.ID = Convert.ToInt32(dr["ID"]);
                    HotelRoomsObj.HotelID = Convert.ToInt32(dr["HotelID"]);
                    HotelRoomsObj.RoomTypeID = Convert.ToInt32(dr["RoomTypeID"]);
                    HotelRoomsObj.RoomTypeName = Convert.ToString(dr["RoomTypeName"]);
                    HotelRoomsObj.RoomSize = Convert.ToInt32(dr["RoomSize"]);
                    HotelRoomsObj.MaxPeopleCount = Convert.ToInt32(dr["MaxPeopleCount"]);
                    HotelRoomsObj.IDWithMaxPeopleCount = Convert.ToString(dr["IDWithMaxPeopleCount"]);
                    HotelRoomsObj.MaxChildrenCount = Convert.ToInt32(dr["MaxChildrenCount"]);
                    HotelRoomsObj.BabyCotCount = Convert.ToInt32(dr["BabyCotCount"]);
                    HotelRoomsObj.ExtraBedCount = Convert.ToInt32(dr["ExtraBedCount"]);
                    HotelRoomsObj.SmokingTypeID = Convert.ToString(dr["SmokingTypeID"]);

                    HotelRoomsObj.SmokingTypeName = Convert.ToString(dr["SmokingTypeName"]);
                    HotelRoomsObj.ViewTypeID = Convert.ToString(dr["ViewTypeID"]);
                    HotelRoomsObj.ViewTypeName = Convert.ToString(dr["ViewTypeName"]);
                    HotelRoomsObj.IncludedInRoomTypeCaption = Convert.ToString(dr["IncludedInRoomTypeCaption"]);

                    Encryption64 objEncryptHotelRoomID = new Encryption64();
                    string EncryptHotelRoomID = Convert.ToString(dr["ID"]);
                    EncryptHotelRoomID = System.Web.HttpContext.Current.Server.UrlEncode(ConvertStringToHex(objEncryptHotelRoomID.Encrypt(EncryptHotelRoomID, "58421043")));
                    HotelRoomsObj.EncryptHotelRoomID = EncryptHotelRoomID;

                    HotelRoomsList.Add(HotelRoomsObj);
                }
            }
            return HotelRoomsList;
        }
Пример #17
0
    protected void ddl_typerequest_SelectedIndexChanged(object sender, EventArgs e)
    {
        Encryption64 e64 = new Encryption64();

        Response.Redirect("~/UI/users/request2.aspx?nosample=" + e64.Encrypt(no_samples.ToString()) + "&notest=" + e64.Encrypt(no_tests.ToString()) + "&rtype=" + e64.Encrypt(ddl_typerequest.SelectedValue));
    }
Пример #18
0
    private void do_mail()
    {
        ds_analytics.m_usersRow req_row = m_users.getUserByUserid(userid)[0];
        string sub = "Analytics: New Request " + reqid + " raised by " + req_row.fullname;
        string from;

        if (req_row.email != "")
        {
            from = req_row.email;
        }
        else
        {
            from = "*****@*****.**";
        }

        WebClient wclient = new WebClient();
        string    url     = HttpContext.Current.Request.Url.AbsoluteUri;

        url = url.Replace("UI/users/request2.aspx", "Mailer/reqsubmit.htm");
        string pagedata = wclient.DownloadString(url);
        string body     = pagedata;

        //mail to receiver
        ds_analytics.m_usersRow rec_row = m_users.getUserByUserid(ddl_lead.SelectedValue)[0];
        if (rec_row != null && rec_row.email != "")
        {
            //1. Creating login page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            int    len      = url.IndexOf("UI");
            string base_url = url.Substring(0, len);
            base_url = base_url + "Default.aspx?login="******"&redirect=";
            //2. Creating request page link
            url = HttpContext.Current.Request.Url.AbsoluteUri;
            len = url.IndexOf("request2");
            string       redirect_url = url.Substring(0, len);
            Encryption64 e64          = new Encryption64();
            redirect_url = redirect_url + "reqaction.aspx?reqid=" + e64.Encrypt(reqid);
            //3. Adding login + redirect link
            string web_link = "<a href='" + base_url + redirect_url + "' target='_blank'>Open Request</a>";
            body = body.Replace("!!~receiver_name~!!", rec_row.fullname);
            body = body.Replace("!!~no_samples~!!", no_samples.ToString());
            body = body.Replace("!!~requestor_name~!!", req_row.fullname);
            body = body.Replace("!!~You can open the request at web_link~!!", "You can open the request at " + web_link);

            string[]      to       = { rec_row.email };
            string[]      cc       = new string[2];
            string[]      bcc      = new string[2];
            analyticsmail ana_mail = new analyticsmail();
            ana_mail.sendmails(to, cc, bcc, from, sub, body, "");
        }

        //mail to Backup-ID
        body = pagedata;
        DataTable dt_bke = other.getDropdownsbyType("backupemail");

        if (dt_bke.Rows.Count > 0)
        {
            DataTable dt_bkn     = other.getDropdownsbyType("backupname");
            string    backupname = "";
            if (dt_bkn.Rows.Count > 0)
            {
                backupname = dt_bkn.Rows[0]["value"].ToString();
            }
            body = body.Replace("!!~receiver_name~!!", backupname);
            body = body.Replace("!!~no_samples~!!", no_samples.ToString());
            body = body.Replace("!!~requestor_name~!!", req_row.fullname);
            body = body.Replace("!!~You can open the request at web_link~!!", "");

            string[]      to       = { dt_bke.Rows[0]["value"].ToString() };
            string[]      cc       = new string[2];
            string[]      bcc      = new string[2];
            analyticsmail ana_mail = new analyticsmail();
            ana_mail.sendmails(to, cc, bcc, from, sub, body, "");
        }
    }
        public List<PropertyRoomsExt> GetPropertyRooms(int HotelID)
        {
            // long HotelID = 100003;
            SQLCon.Open();
            SqlCommand cmd = new SqlCommand("TB_SP_GetHotelRooms", SQLCon);
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@Culture", CultureValue);
            cmd.Parameters.AddWithValue("@OrderBy", "ID");
            cmd.Parameters.AddWithValue("@HotelID",HotelID);
            cmd.Parameters.AddWithValue("@Active", true);
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            sda.Fill(dt);
            SQLCon.Close();

            List<PropertyRoomsExt> ListOfModel = new List<PropertyRoomsExt>();

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    //if (!ArrayID.Contains(Convert.ToInt32(dr["ID"])))
                    //{
                    PropertyRoomsExt HotelRoom = new PropertyRoomsExt();

                    HotelRoom.ID = Convert.ToInt32(dr["ID"]);
                    HotelRoom.HotelID = Convert.ToInt64(dr["HotelID"]);
                    HotelRoom.RoomTypeID = Convert.ToInt32(dr["RoomTypeID"]);
                    HotelRoom.RoomCount = dr["RoomCount"].ToString();

                    HotelRoom.RoomTypeName = dr["RoomTypeName"].ToString();
                    HotelRoom.RoomSize = dr["RoomSize"].ToString();
                    HotelRoom.MaxPeopleCount = dr["MaxPeopleCount"].ToString();

                    HotelRoom.IDWithMaxPeopleCount = dr["IDWithMaxPeopleCount"].ToString();
                    HotelRoom.MaxChildrenCount = dr["MaxChildrenCount"].ToString();
                    HotelRoom.BabyCotCount = dr["BabyCotCount"].ToString();

                    HotelRoom.ExtraBedCount = dr["ExtraBedCount"].ToString();
                    HotelRoom.SmokingTypeID = dr["SmokingTypeID"].ToString();
                    HotelRoom.SmokingTypeName = dr["SmokingTypeName"].ToString();

                    HotelRoom.ViewTypeID = dr["ViewTypeID"].ToString();
                    HotelRoom.ViewTypeName = dr["ViewTypeName"].ToString();
                    HotelRoom.IncludedInRoomTypeCaption = dr["IncludedInRoomTypeCaption"].ToString();

                    HotelRoom.Active = Convert.ToBoolean(dr["Active"]);
                    HotelRoom.CreateDateTime = dr["CreateDateTime"].ToString();
                    HotelRoom.CreateUserID = dr["CreateUserID"].ToString();

                    HotelRoom.OpDateTime = dr["OpDateTime"].ToString();
                    HotelRoom.OpUserID = dr["OpUserID"].ToString();

                    Encryption64 objEncryptreservation = new Encryption64();
                    string EncryptRoomID = dr["ID"].ToString();
                    EncryptRoomID = System.Web.HttpContext.Current.Server.UrlEncode(ConvertStringToHex(objEncryptreservation.Encrypt(EncryptRoomID, "58421043")));
                    HotelRoom.EncryptRoomID = EncryptRoomID;

                    ListOfModel.Add(HotelRoom);
                    //}

                }
            }
            return ListOfModel;
        }
Пример #20
0
 protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         Encryption64 e64   = new Encryption64();
         long         labid = Convert.ToInt64(((Label)(e.Item.FindControl("lbl_labid"))).Text);
         ((HyperLink)(e.Item.FindControl("hl_cover_letter"))).NavigateUrl = "~/UI/users/cover_letter1.aspx?reqid=" + e64.Encrypt(reqid) + "&labid=" + e64.Encrypt(labid.ToString());
         ((HyperLink)(e.Item.FindControl("hl_challan"))).NavigateUrl      = "~/UI/users/challan1.aspx?reqid=" + e64.Encrypt(reqid) + "&labid=" + e64.Encrypt(labid.ToString());
         ((HyperLink)(e.Item.FindControl("hl_labels"))).NavigateUrl       = "~/UI/users/labels1.aspx?reqid=" + e64.Encrypt(reqid) + "&labid=" + e64.Encrypt(labid.ToString());
     }
 }
Пример #21
0
 /// <summary>
 /// Encode a ecoded string value
 /// </summary>
 /// <param name="encodedvalue"></param>
 /// <returns></returns>
 public static string ToEncoding(string value)
 {
     return(Encryption64.Encrypt(value, "1A2B3C4D").ToLower());
 }
Пример #22
0
    protected void gv_req_by_me_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        Encryption64 e64 = new Encryption64();

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            //set transfer url on double click
            DataKey key      = gv_req_by_me.DataKeys[e.Row.RowIndex];
            string  reqid    = key.Value.ToString();
            string  url      = string.Empty;
            string  statusid = e.Row.Cells[5].Text;

            //set copy request url
            string    nosample = e64.Encrypt(req_samples.countSamplesByReqId(reqid).ToString());
            string    notest   = e64.Encrypt(req_tests.countTestsByReqId(reqid).ToString());
            string    rtype    = e64.Encrypt(requests.getRequestbyReqid(reqid)[0].reqtype);
            string    copy_url = "~/UI/users/process_request1.aspx?mode=copy&user=requestor&process_reqid=" + e64.Encrypt(reqid) + "&nosample=" + nosample + "&notest=" + notest + "&rtype=" + rtype;
            HyperLink hl_copy  = (HyperLink)e.Row.FindControl("hl_copy");
            hl_copy.NavigateUrl = copy_url;

            if (statusid == "1")
            {
                //Request Incomplete
                int no_samples = req_samples.countSamplesByReqId(reqid);
                int no_tests   = req_tests.countTestsByReqId(reqid);

                // disable copy request
                hl_copy.Visible = false;

                //for draft requests
                //url="request3.aspx?nosample=" + (e64.Encrypt(no_samples.ToString())) + "&notest=" + e64.Encrypt(no_tests.ToString()) + "&reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "2")
            {
                //Requested
                url = "reqaction_byme.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "3")
            {
                //Approved
                url = "reqaction_byme.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "4")
            {
                //Declined
                url = "reqaction_byme.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "5")
            {
                //In Progress
                url = "reqaction_byme.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "6")
            {
                //Complete
                url = "reqaction_byme.aspx?reqid=" + e64.Encrypt(reqid);
            }
            else if (statusid == "7")
            {
                //Draft
                e.Row.Attributes.Add("ondblclick", "alert('Request has been cancelled.')");
                // disable copy request
                hl_copy.Visible = false;
            }

            //onclick
            if (url != string.Empty)
            {
                e.Row.Attributes.Add("ondblclick", "transferLink('" + url + "')");
            }

            //css
            e.Row.CssClass = "row";
            //fullname
            e.Row.Cells[3].Text = m_users.getFullnameByuserid(e.Row.Cells[3].Text);
            //date
            e.Row.Cells[4].Text = Convert.ToDateTime(e.Row.Cells[4].Text).ToString("dd/MMM/yy hh:mm tt");
            //status must be set in the end
            e.Row.Cells[5].Text = other.getStatustext(Convert.ToInt32(e.Row.Cells[5].Text));
        }
    }
Пример #23
0
    public static string EncryptQueryString(string strQueryString)
    {
        Encryption64 oES = new Encryption64();

        return(oES.Encrypt(strQueryString, "!#$a54?3"));
    }
Пример #24
0
    public static string EncryptString(string str)
    {
        Encryption64 oES = new Encryption64();

        return(oES.Encrypt(str, "@n!k$en1"));
    }
        protected async Task Salvar(EditContext editContext)
        {
            if (!editContext.Validate())
            {
                return;
            }

            var usuarioExiste = await UsuariosServico.GetPorEmailAsync(_usuarioViewModel.Email);

            if (_usuarioViewModel.Id == Guid.Empty && usuarioExiste != null)
            {
                ToastService.ShowInfo("Já existe um usuário cadastrado com este email!");
                return;
            }

            if (_senhaEdicao != _usuarioViewModel.Senha)
            {
                _usuarioViewModel.Senha = Encryption64.Encrypt(_usuarioViewModel.Senha);
            }

            switch (_usuarioViewModel.CargoId)
            {
            case CargosConst.Administrador:
                var administrador = Mapper.Map <AdministradorDTO>(_usuarioViewModel);
                await PostOrPutAsync(AdministradoresServico, administrador);

                break;

            case CargosConst.Recepcionista:
                var recepcionista = Mapper.Map <RecepcionistaDTO>(_usuarioViewModel);
                await PostOrPutAsync(RecepcionistasServico, recepcionista);

                break;

            case CargosConst.Laboratorio:
                var laboratorio = Mapper.Map <LaboratorioDTO>(_usuarioViewModel);
                await PostOrPutAsync(LaboratoriosServico, laboratorio);

                break;

            case CargosConst.Medico:
                var medicoExiste = await MedicosServico.GetPorCRMAsync(_usuarioViewModel.CRM);

                if (_usuarioViewModel.Id == Guid.Empty && medicoExiste != null)
                {
                    ToastService.ShowInfo($"O médico {medicoExiste.Nome} já está cadastrado com o CRM {_usuarioViewModel.CRM}!");
                    return;
                }

                if (!_usuarioViewModel.Especialidades.Any())
                {
                    ToastService.ShowInfo("Deve ser selecionado ao menos uma especialidade!");
                    return;
                }

                var horariosSelecionados = _usuarioViewModel.HorariosDeTrabalho.Where(_ => _.Selecionado);
                if (!horariosSelecionados.Any())
                {
                    ToastService.ShowInfo("Deve ser selecionado ao menos um horário de trabalho!");
                    return;
                }

                var medico = Mapper.Map <MedicoDTO>(_usuarioViewModel);
                await PostOrPutAsync(MedicosServico, medico);

                break;

            default:
                ToastService.ShowWarning("O cargo informado é inválido");
                break;
            }
        }