예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"] == null)
            {
                Response.Redirect("../../close_win.aspx");
            }

            SqlConnection sqlConn = new SqlConnection(CBSAppUtils.PrimaryConnectionString);

            DC = new DataCenter(sqlConn);

            if (!IsPostBack)
            {
                int sComID = (int)Session["CompanyID"];
                DC.PopulateChildCompany(sComID, ddlCompany);

                string v = ddlCompany.Items[0].Value;
                ddlCompany.SelectedValue = v;
                ddlCompany_SelectedIndexChanged(sender, e);
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            sqlConn = new SqlConnection(CBSAppUtils.PrimaryConnectionString);
            DC      = new DataCenter(sqlConn);

            if (!IsPostBack)
            {
                if (Request.QueryString.Count > 0)
                {
                    int comID = Convert.ToInt32(Request.QueryString["cid"]);
                    int docID = Convert.ToInt32(Request.QueryString["did"]);

                    DownloadAndSetTiffImage(comID, docID);
                }

                //#region DBCon
                //if (string.Equals(Convert.ToString(Session["type"]), "old"))
                //{
                //    ctlTiff.CacheZoom = 100;
                //    ctlTiff.ViewerWidth = 750;
                //    ctlTiff.ThumbWidth = 45;
                //    ScriptManager.RegisterStartupScript(this, this.GetType(), "zoom", "objTiffViewer.Zoom(25);", true);
                //    //ctlTiff.DefaultZoom = 100;
                //}
                //else
                //{
                //    ctlTiff.CacheZoom = 200;
                //    ctlTiff.ViewerWidth = 0;
                //    ctlTiff.ThumbWidth = 65;
                //    ScriptManager.RegisterStartupScript(this, this.GetType(), "zoom", "objTiffViewer.Zoom(50);", true);
                //    //ctlTiff.DefaultZoom = 200;
                //}
                //#endregion
            }

            Page.LoadComplete += new EventHandler(Page_LoadComplete);
        }
예제 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserID"] == null)
            {
                Response.Redirect("../../close_win.aspx");
            }

            if (Request.QueryString.Count == 0)
            {
                btnCancel_Click(sender, e);
            }

            SqlConnection sqlConn = new SqlConnection(CBSAppUtils.PrimaryConnectionString);

            DC = new DataCenter(sqlConn);

            if (!IsPostBack)
            {
                int comID  = Convert.ToInt32(Request.QueryString["cid"]);
                int docID  = Convert.ToInt32(Request.QueryString["did"]);
                int sComID = (int)Session["CompanyID"];

                DC.PopulateChildCompany(sComID, ddlCompany);
                ddlCompany.SelectedValue = DC.ReturnClientCompanyID(docID).ToString();
                ddlCompany_SelectedIndexChanged(sender, e);
                ddlBatchType_SelectedIndexChanged(sender, e);
            }

            int c = 0;

            if (Session["pages"] != null)
            {
                c = Convert.ToInt32(Session["pages"]);
            }
            LoadCheckBoxes(c);
        }
예제 #4
0
        public static string PageUnload(string docID)
        {
            string ret    = "";
            string isNext = (HttpContext.Current.Session["IsNextDoc"] != null) ? HttpContext.Current.Session["IsNextDoc"].ToString() : "False";

            docID = string.IsNullOrEmpty(docID) ? "0" : docID;

            try
            {
                SqlConnection sqlConn = new SqlConnection(CBSAppUtils.PrimaryConnectionString);
                DataCenter    DC      = new DataCenter(sqlConn);

                bool tf = DC.UpdateBeingEdited("NO", Convert.ToInt32(docID));

                if (tf)
                {
                    #region Set BEING EDITED COUNT value to 0
                    //Session of SingleRowTable is updated with newly edited table

                    DataTable DT      = new DataTable();
                    string    colName = "BEING EDITED COUNT";

                    if (HttpContext.Current.Session["SingleRowTable"] != null)
                    {
                        DT = (DataTable)HttpContext.Current.Session["SingleRowTable"];
                    }

                    for (int i = 0; i < DT.Columns.Count; i++)
                    {
                        if (DT.Columns[i].ColumnName == colName)
                        {
                            DT.Rows[0][i] = 0;
                            break;
                        }
                    }

                    if (HttpContext.Current.Session["SingleRowTable"] != null)
                    {
                        HttpContext.Current.Session.Remove("SingleRowTable");
                    }

                    HttpContext.Current.Session["SingleRowTable"] = DT;

                    if (isNext == false.ToString())
                    {
                        if (HttpContext.Current.Session["BatchIDList"] != null)
                        {
                            HttpContext.Current.Session.Remove("BatchIDList");
                        }

                        if (HttpContext.Current.Session["IsSingleDoc"] != null)
                        {
                            HttpContext.Current.Session.Remove("IsSingleDoc");
                        }

                        if (HttpContext.Current.Session["IsSingleBatch"] != null)
                        {
                            HttpContext.Current.Session.Remove("IsSingleBatch");
                        }

                        if (HttpContext.Current.Session["IsNextDoc"] != null)
                        {
                            HttpContext.Current.Session.Remove("IsNextDoc");
                        }
                    }
                    #endregion
                }

                ret = "True";
            }
            catch (Exception ex)
            {
                ret = ex.Message;
            }

            return(ret);
        }