Ejemplo n.º 1
0
 protected void sostatus1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (sostatus1.SelectedValue == "OPEN")
     {
         RadDatePicker_CloseDate.Clear();
         RadDatePicker_CloseDate.Enabled = false;
     }
     else
     {
         RadDatePicker_CloseDate.SelectedDate = DateTime.Now;
         RadDatePicker_CloseDate.Enabled      = true;
     }
 }
Ejemplo n.º 2
0
        protected void grdSOLog_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.Item.ItemType != GridItemType.FilteringItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                LinkButton   lnk  = (LinkButton)item["so_no"].Controls[0];

                if (e.CommandName == "StatusEdit")
                {
                    string _sono = lnk.Text;
                    txt_subject.Attributes.Add("so_id", DataBinder.Eval(e.Item.DataItem, "so_id").ToString());
                    Label lbl = (Label)e.Item.FindControl("lblSubject");
                    txt_subject.Text = lbl.Text.Replace(" <br /> ", "\n");

                    if (rcbService_Edit.Items.Count > 0)
                    {
                        rcbService_Edit.SelectedValue = rcbService_Edit.Items.FindItemByText(item["package"].Text).Value;
                    }
                    if (sostatus1.Items.Count > 0)
                    {
                        sostatus1.SelectedValue = sostatus1.Items.FindItemByText(item["drstatus"].Text).Value;
                    }

                    if (lblNewProject.Text == "1")
                    {
                        if (item["drstatus"].Text == "OPEN")
                        {
                            RadDatePicker_CloseDate.Clear();
                            RadDatePicker_CloseDate.Enabled = false;
                        }
                        else
                        {
                            if (item["Closeout_Date"].Text != null && (Server.HtmlDecode(item["Closeout_Date"].Text).Trim() != string.Empty) && item["Closeout_Date"].Text != "-")
                            {
                                RadDatePicker_CloseDate.SelectedDate = DateTime.ParseExact(item["Closeout_Date"].Text, "dd/MM/yyyy", null);
                            }
                        }

                        string building = (item["Building"] == null) ? string.Empty : (Server.HtmlDecode(item["Building"].Text).Trim());
                        if (building != string.Empty)
                        {
                            rcbBuilding_Edit.Items.FindItemByText(building).Selected = true;
                        }
                        else
                        {
                            rcbBuilding_Edit.ClearSelection();
                        }
                    }
                    else
                    {
                        RadDatePicker_CloseDate.Visible = false;
                        trcdate.Visible = false;
                    }

                    string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);$find(\"" + RadWindow1.ClientID + "\").set_title('SO Details - " + _sono + " '); ";
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
                }
                else if (e.CommandName == "SOEdit")
                {
                    string _service    = grdSOLog.MasterTableView.GetColumn("package").CurrentFilterValue;
                    string _recordedby = grdSOLog.MasterTableView.GetColumn("userid").CurrentFilterValue;
                    string _issuedto   = grdSOLog.MasterTableView.GetColumn("issued").CurrentFilterValue;
                    string _status     = grdSOLog.MasterTableView.GetColumn("drstatus").CurrentFilterValue;
                    string _fil        = "&filter=" + grdSOLog.MasterTableView.FilterExpression.ToString();
                    string _filter     = "&SER=" + _service + "&RVW=" + _recordedby + "&ISS=" + _issuedto + "&STA=" + _status + "&ACN=1" + _fil;

                    string _prm = "id=" + DataBinder.Eval(e.Item.DataItem, "so_id").ToString() + "&PRJ=" + lblprj.Text + _filter;

                    if (lblNewProject.Text == "1")
                    {
                        string _building = grdSOLog.MasterTableView.GetColumn("building").CurrentFilterValue;
                        _prm = _prm + "&building=" + _building;
                    }

                    if (isNewProject)
                    {
                        //if (lblprj.Text == "123" || lblprj.Text == "Traini" || lblprj.Text == "demo" || lblprj.Text == "HMIM" || lblprj.Text == "HMHS" || lblprj.Text == "MOE" || lblprj.Text == "11784" || lblprj.Text == "AZC" || lblprj.Text == "NCP")
                        Response.Redirect("sodetails_new.aspx?" + _prm);
                    }
                    else
                    {
                        Response.Redirect("sodetails.aspx?" + _prm);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        protected void mygrid_dr_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int         _idx       = Convert.ToInt32(e.CommandArgument);
            GridViewRow _srow      = mygrid_dr.Rows[_idx];
            TableCell   _drid      = _srow.Cells[14];
            TableCell   _drno      = _srow.Cells[13];
            TableCell   _ser       = _srow.Cells[1];
            TableCell   _doc       = _srow.Cells[3];
            TableCell   _stat      = _srow.Cells[9];
            TableCell   _issueDate = _srow.Cells[4];

            Label2.Text = _drid.Text;
            if (e.CommandName == "get")
            {
                // lbldrno.Text = _btn.Text;
                //mydiv.Visible = true;
                //load_doc_review_details();
                string _prm = "";
                if (lblprj.Text == "HPOB")
                {
                    _prm = "cmsdocumentreview_details1.aspx?id=" + _drid.Text + "_P" + lblprj.Text;
                }
                else
                {
                    // _prm = "cmsdocreview_details.aspx?id=" + _drid.Text + "_P" + lblprj.Text;
                    _prm = "cmsdocreview_details.aspx?id=" + _drid.Text + "&PRJ=" + lblprj.Text + "&SER=" + dr_service.Text + "&RVW=" + drreview.Text + "&ISS=" + drissue.Text + "&STA=" + drstatus.Text + "&ACN=1&BUI=" + drbuilding.SelectedItem.Text;
                }

                //ScriptManager.RegisterStartupScript(this, typeof(string), "Message", "window.open('" + _prm + "','','left=50,top=50,width=1300,height=600,menubar=1,toolbar=1,scrollbars=1,status=0,resizable=1');", true);
                Response.Redirect(_prm);
            }
            else if (e.CommandName == "status")
            {
                txt_subject.Text = _doc.Text;
                if (_srow.Cells[9].Text == "OPEN")
                {
                    RadDatePicker_CloseDate.Clear();
                    RadDatePicker_CloseDate.Enabled = false;
                }
                else
                {
                    if (lblNewProject.Text == "1")
                    {
                        RadDatePicker_CloseDate.Enabled = true;
                        if (_srow.Cells[10] != null && _srow.Cells[10].Text != string.Empty && _srow.Cells[10].Text != "-")
                        {
                            RadDatePicker_CloseDate.SelectedDate = DateTime.ParseExact(_srow.Cells[10].Text, "dd/MM/yyyy", null);
                        }
                        else
                        {
                            RadDatePicker_CloseDate.Clear();
                        }
                    }
                    else
                    {
                        trCloseDate.Visible = false;
                    }
                }

                if (lblNewProject.Text == "1")
                {
                    string building = (_srow.Cells[2] == null) ? string.Empty : (Server.HtmlDecode(_srow.Cells[2].Text).Trim());
                    if (building != string.Empty)
                    {
                        rcbBuilding_Edit.Items.FindItemByText(building).Selected = true;
                    }
                    else
                    {
                        rcbBuilding_Edit.ClearSelection();
                    }
                }

                if (rcbService_Edit.Items.Count > 0)
                {
                    rcbService_Edit.SelectedValue = rcbService_Edit.Items.FindItemByText(_ser.Text).Value;
                }
                if (sostatus1.Items.Count > 0)
                {
                    sostatus1.SelectedValue = sostatus1.Items.FindItemByText(_stat.Text).Value;
                }
                string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);$find(\"" + RadWindow1.ClientID + "\").set_title('DR Details - " + _drno.Text + " '); ";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
            }
        }