protected void Button_sign_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["id"])) { return; } int form_id = Int32.Parse(Request.QueryString["id"]); LykosDB.UpdateFormStatus(form_id, 4); Response.Redirect("Default.aspx"); }
public void GridView_forms_RowCommand(object sender, GridViewCommandEventArgs e) { // If multiple buttons are used in a GridView control, use the // CommandName property to determine which button was clicked. if (e.CommandName == "DeleteItem") { var id = Int32.Parse(e.CommandArgument.ToString()); LykosDB.DeleteForm(id); //delete attachments var di = new DirectoryInfo(Server.MapPath("myfiles") + "\\" + id + "\\"); if (di.Exists) { di.Delete(true); } BindData(GridView_forms); } }
protected void Button_send_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["id"])) { return; } int form_id = Int32.Parse(Request.QueryString["id"]); LykosDB.UpdateFormStatus(form_id, 3); try { User user = Handlers.User.GetCurrentUserInfo(); Handlers.User.SendMail(user.fullName); } catch (Exception ex) { Response.Redirect("~/Error.aspx?msg=SendMail:" + ex.Message.Replace("\n", "").Replace("<br>", "")); } Response.Redirect("Default.aspx"); }
protected void Page_Load(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["form_id"])) { Response.Redirect("~/Error.aspx"); } int form_id = Int32.Parse(Request.QueryString["form_id"]); if (!LykosDB.IfFormExists(form_id)) { Response.Redirect("~/Error.aspx"); } User user = Handlers.User.GetCurrentUserInfo(); var user_id = user.user_id; var user_role = user.role; if (!LykosDB.IfFormBelongsToUser(form_id, user.user_id, user_role)) { Response.Redirect("~/Error.aspx"); } FormInfo formInfo = Handlers.LykosDB.GetFormInfo(form_id); Label_author.Text = formInfo.operator_name; Label_formName.Text = formInfo.name; SqlDataSource_form.SelectCommand = string.Format("SELECT " + "[product_name].name as [Product name], " + "[pharmaceutical_form].name as [Pharmaceutical form], " + "[strength].name as [Strength], " + "[cis].name as [CIS], " + "[country_impacted].name as [Country impacted], " + "[product_code].name as [Product code], " + "[marketing_authorithation_holder].name as [Marketing authorithation holder], " + "[change_initiator].name as [Change initiator], " + "[date_of_request] as [Date of request], " + "[type_of_artwork].name as [Type of artwork], " + "[type_of_change].name as [Type of change], " + "[variation_type].name as [Variation type], " + "CASE when inf.submission_date like \'0001-01-01\' " + "THEN \'No\' ELSE \'Yes, \' + change_need_submit.name + \' \' + CAST(inf.submission_date as nvarchar) END AS [Does this change need to be submitted to regulatory authority before implementation?], " + "CASE when inf.approve_date like \'0001-01-01\' " + "THEN \'No\' ELSE \'Yes, \' + change_need_approve.name + \' \' + CAST(inf.approve_date as nvarchar) END AS [Does this change need to be approved by regulatory authority before implementation?], " + "CASE when inf.packaging_matrials_dedline like \'0001-01-01\' " + "THEN [packaging_matrials_period].name ELSE [packaging_matrials_period].name + \' \' +CAST(inf.packaging_matrials_dedline as nvarchar) END AS [How long can old packaging matrials still be used at manufacturing site after approval/notification?], " + "CASE when inf.sell_out_dedline like \'0001-01-01\' " + "THEN [sell_out_period].name ELSE [sell_out_period].name + \' \' +CAST(inf.sell_out_dedline as nvarchar) END AS [How long is the sell-out period of the imported finished product manufactured with old packaging after approval in the country?], " + "[comments1] as Comments, " + "[component_type].name as [Type of component (should be attach approved artwork)], " + "[change_strategy].name as [Change strategy], " + "[comments2] as Comments2, " + "[implementation_date] as [Implementation Date] " + "FROM [result].[forms_info] as inf " + "LEFT OUTER JOIN product_name as [product_name] " + "ON inf.[product_name] = [product_name].id " + "LEFT OUTER JOIN pharmaceutical_form as [pharmaceutical_form] " + "ON inf.[pharmaceutical_form] = [pharmaceutical_form].id " + "LEFT OUTER JOIN strength as [strength] " + "ON inf.[strength] = [strength].id " + "LEFT OUTER JOIN product_code as [product_code] " + "ON inf.[product_code] = [product_code].id " + "LEFT OUTER JOIN marketing_authorithation_holder as [marketing_authorithation_holder] " + "ON inf.[marketing_authorithation_holder] = [marketing_authorithation_holder].id " + "LEFT OUTER JOIN country_impacted as [country_impacted] " + "ON inf.[country_impacted] = [country_impacted].id " + "LEFT OUTER JOIN change_initiator as [change_initiator] " + "ON inf.[change_initiator] = [change_initiator].id " + "LEFT OUTER JOIN type_of_artwork as [type_of_artwork] " + "ON inf.[type_of_artwork] = [type_of_artwork].id " + "LEFT OUTER JOIN type_of_change as [type_of_change] " + "ON inf.[type_of_change] = [type_of_change].id " + "LEFT OUTER JOIN variation_type as [variation_type] " + "ON inf.[variation_type] = [variation_type].id " + "LEFT OUTER JOIN change_need_submit as [change_need_submit] " + "ON inf.[change_need_submit] = [change_need_submit].id " + "LEFT OUTER JOIN change_need_approve as [change_need_approve] " + "ON inf.[change_need_approve] = [change_need_approve].id " + "LEFT OUTER JOIN packaging_matrials_period as [packaging_matrials_period] " + "ON inf.[packaging_matrials_period] = [packaging_matrials_period].id " + "LEFT OUTER JOIN sell_out_period as [sell_out_period] " + "ON inf.[sell_out_period] = [sell_out_period].id " + "LEFT OUTER JOIN component_type as [component_type] " + "ON inf.[component_type] = [component_type].id " + "LEFT OUTER JOIN change_strategy as [change_strategy] " + "ON inf.[change_strategy] = [change_strategy].id " + "LEFT OUTER JOIN result.forms as frm " + "ON inf.[form_id] = frm.id " + "LEFT OUTER JOIN dbo.users as usrs " + "on frm.[operator_id] = usrs.id " + "LEFT OUTER JOIN dbo.[form_status] as sts " + "on frm.[status_id] = sts.id " + "LEFT OUTER JOIN dbo.[user_role] as usr_rl " + "on usr_rl.id = usrs.user_role_id " + "LEFT OUTER JOIN info.cis as [cis] " + "ON inf.[cis_id] = [cis].id " + "WHERE [form_id] = {0}", form_id); DetailsView_form.DataSourceID = "SqlDataSource_form"; DetailsView_form.DataBind(); int rowsCount = DetailsView_form.Rows.Count; Label labelManufacturer = (Label)DetailsView_form.Rows[rowsCount - 2].FindControl("Label_manufacturer"); labelManufacturer.Text = LykosDB.GetManufactures(form_id.ToString()); Label labelComponentType = (Label)DetailsView_form.Rows[rowsCount - 1].FindControl("Label_componenet_type"); labelComponentType.Text = LykosDB.GetComponentTypes(form_id.ToString()); try { ExportToExcel(formInfo.operator_name); } catch (ThreadAbortException ex) { } catch (Exception ex) { Response.Redirect("~/Error.aspx?msg=ExportToExcel:" + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (String.IsNullOrEmpty(Request.QueryString["id"])) { Response.Redirect("Error.aspx"); } int id = Int32.Parse(Request.QueryString["id"]); if (!LykosDB.IfFormExists(id)) { Response.Redirect("Error.aspx"); } User user = Handlers.User.GetCurrentUserInfo(); var user_id = user.user_id; var user_role = user.role; if (!LykosDB.IfFormBelongsToUser(id, user.user_id, user_role)) { Response.Redirect("Error.aspx"); } if (user_role.Equals("manager")) { Button_sign.Visible = false; } FormInfo formInfo = Handlers.LykosDB.GetFormInfo(id); TextBox_formName.Text = formInfo.name; TextBox_comments1.Text = formInfo.comments1; TextBox_comments2.Text = formInfo.comments2; TextBox_productName.Text = formInfo.product_name; TextBox_pharmaceutical_form.Text = formInfo.pharmaceutical_form; TextBox_strength.Text = formInfo.strength; TextBox_product_code.Text = formInfo.product_code; TextBox_marketing_authorithation_holder.Text = formInfo.marketing_authorithation_holder; TextBox_country_impacted.Text = formInfo.country_impacted; TextBox_change_initiator.Text = formInfo.change_initiator; TextBox_type_of_artwork.Text = formInfo.type_of_artwork; TextBox_type_of_change.Text = formInfo.type_of_change; TextBox_variation_type.Text = formInfo.variation_type; TextBox_change_need_submit.Text = formInfo.change_need_submit; TextBox_change_need_approve.Text = formInfo.change_need_approve; TextBox_packaging_matrials_period.Text = formInfo.packaging_matrials_period; TextBox_sell_out_period.Text = formInfo.sell_out_period; //TextBox_component_type.Text = formInfo.component_type; TextBox_change_strategy.Text = formInfo.change_strategy; TextBox_dateRequest.Text = formInfo.date_of_request.Substring(0, 10); TextBox_dateImplmnt.Text = formInfo.implementation_date.Substring(0, 10); TextBox_operator_name.Text = formInfo.operator_name; TextBox_operator_rank.Text = formInfo.user_comments; TextBox_form_status.Text = formInfo.form_status; TextBox_cis.Text = formInfo.cis; TextBox_submissDate.Text = formInfo.submiss_date.Substring(0, 10); TextBox_approveDate.Text = formInfo.approve_date.Substring(0, 10); TextBox_packaging_matrials_dedline.Text = formInfo.packaging_matrials_dedline.Substring(0, 10); TextBox_sell_out_dedline.Text = formInfo.sell_out_dedline.Substring(0, 10); if (!string.IsNullOrEmpty(formInfo.change_need_submit)) { TextBox_submissDate.Visible = true; TextBox_change_need_submit.Visible = true; Label_need_submit.Text = "Yes"; } if (!string.IsNullOrEmpty(formInfo.change_need_approve)) { TextBox_approveDate.Visible = true; TextBox_change_need_approve.Visible = true; Label_need_approve.Text = "Yes"; } if (formInfo.packaging_matrials_period.Contains("define deadline")) { TextBox_packaging_matrials_dedline.Visible = true; } if (formInfo.sell_out_period.Contains("define deadline")) { TextBox_sell_out_dedline.Visible = true; } if (formInfo.form_status.Equals("signed")) { Button_sign.Visible = false; Button_send.Visible = false; } if (formInfo.form_status.Equals("send_tosign")) { Button_send.Visible = false; } foreach (var item in formInfo.manufacturer) { CheckBoxList_manufacturer.Items.Add(item.ToString()); } foreach (ListItem item in CheckBoxList_manufacturer.Items) { item.Selected = true; } foreach (var item in formInfo.component_types) { string componentTypeAttch = LykosDB.GetComponentTypeAttch(id, item.ToString()); string url = string.IsNullOrEmpty(componentTypeAttch) ? "#" : string.Format("~/myfiles/{0}/{1}", id, componentTypeAttch); string text = string.IsNullOrEmpty(componentTypeAttch) ? " - no attached file" : " - " + componentTypeAttch; ListItem item0 = new ListItem($"{item}{text}", url); BulletedList_component_type.Items.Add(item0); } foreach (var item in formInfo.attachments) { BulletedList_attachements.Items.Add(item.ToString()); } }