private void WriteUserActivity(string strActivity, string strLogStatus = "")
        {
            if (Session["UserName"] != null && Session["UserNameId"] != null && Session["UserTypeId"] != null && Session["UserType"] != null && Session["IPAddress"] != null && Session["hostName"] != null)
            {
                ML_UserLog objML_UserLog = new ML_UserLog();
                objBusinessClass = new BusinessLayer.BusinessClass();
                try
                {
                    objML_UserLog.UserLog         = ML_Common.string2string(Session["UserName"]);
                    objML_UserLog.UserName        = ML_Common.string2string(Session["UserName"]);
                    objML_UserLog.UserNameId      = ML_Common.string2Long(Session["UserNameId"]);
                    objML_UserLog.Email           = string.Empty;
                    objML_UserLog.UserTypeId      = ML_Common.string2Long(Session["UserTypeId"]);
                    objML_UserLog.UserType        = ML_Common.string2string(Session["UserType"]);
                    objML_UserLog.LogStatus       = strLogStatus;
                    objML_UserLog.IPAddress       = ML_Common.string2string(Session["IPAddress"]);
                    objML_UserLog.MachineHostName = ML_Common.string2string(Session["hostName"]);

                    objML_UserLog.UserActivity = strActivity;
                    objML_UserLog.Remarks      = string.Empty;
                    objBusinessClass.AddUserLog(objML_UserLog);
                }
                catch { }
            }
            else
            {
                Response.Redirect("Login.aspx", false);
            }
        }
        private void FillObjectToForm(long lngId, bool IsEditFlag = true)
        {
            objBusinessClass = new BusinessLayer.BusinessClass();
            try
            {
                if (ViewState["ReportType"] != null && ViewState["grdSanitizationReportId"] != null)
                {
                    string ReportType = ML_Common.string2string(ViewState["ReportType"].ToString());
                    lngId = ML_Common.string2Long(ViewState["grdSanitizationReportId"].ToString());

                    // string ReportType = ML_Common.GetDropDownValue(ddlReportTypeSearch, true);
                    ML_SanitizationReport objML_SanitizationReport = objBusinessClass.GetSCSanitizationResultByReportTypeandId(lngId, ReportType);

                    if (objML_SanitizationReport != null)
                    {
                        //ViewState["SanitizationResultId"] = objML_SanitizationReport.SanitizationResultId;
                        //ViewState["SanitizationStartDate"] = objML_SanitizationReport.SanitizationStartDate;
                        //ViewState["SanitizationEndDate"] = objML_SanitizationReport.SanitizationEndDate;
                        //FillGridForData();
                        ShowReport(objML_SanitizationReport.Id, objML_SanitizationReport.ReportType);
                    }
                    //UpdatePanelGridResult.Update();
                }
            }
            catch (Exception ex)
            {
                Exception exc = ex;
            }
        }
        protected void grdSanitizationReport_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                // Guid  guid = ML_Common.String2Guid(grdSanitizationReport.DataKeys[e.RowIndex].Values[0].ToString());
                long lngId = ML_Common.string2Long(grdSanitizationReport.DataKeys[e.RowIndex].Values[0].ToString());

                DeleteGridRowItem(lngId);
                ViewState["grdSanitizationReport"] = null;
                FillGrid();
                FormFieldsClear();
                //PanelEditFormDisplay(false);

                lblMsg.Text = string.Empty;
            }
            catch (Exception ex)
            {
                Exception exc = ex;
            }
        }
        protected void Show_Hide_OrdersGrid(object sender, EventArgs e)
        {
            ImageButton imgShowHide = (sender as ImageButton);
            GridViewRow row         = (imgShowHide.NamingContainer as GridViewRow);

            if (imgShowHide.CommandArgument == "Show")
            {
                row.FindControl("pnlOrders").Visible = true;
                imgShowHide.CommandArgument          = "Hide";
                imgShowHide.ImageUrl = "~/images/minus.png";

                //DataKey arr = grdSanitizationReport.DataKeys[row.RowIndex];

                //DataKeyArray arr2 = grdSanitizationReport.DataKeyNames

                string SanitizationResultId  = grdSanitizationReport.DataKeys[row.RowIndex].Values[1].ToString();
                string SanitizationStartDate = grdSanitizationReport.DataKeys[row.RowIndex].Values[2].ToString();
                string SanitizationEndDate   = grdSanitizationReport.DataKeys[row.RowIndex].Values[3].ToString();



                ViewState["SanitizationResultId"]  = null;
                ViewState["SanitizationStartDate"] = null;
                ViewState["SanitizationEndDate"]   = null;


                // long SanitizationResultId = (long)ViewState["SanitizationResultId"];
                ViewState["SanitizationResultId"]  = ML_Common.string2Long(SanitizationResultId);
                ViewState["SanitizationStartDate"] = ML_Common.ToDateTimeSafe(SanitizationStartDate);
                ViewState["SanitizationEndDate"]   = ML_Common.ToDateTimeSafe(SanitizationEndDate);

                GridView gvChild = row.FindControl("grdSanitizationSGP125TData") as GridView;
                BindChildGrid(gvChild);
            }
            else
            {
                row.FindControl("pnlOrders").Visible = false;
                imgShowHide.CommandArgument          = "Show";
                imgShowHide.ImageUrl = "~/images/plus.png";
            }
        }