Ejemplo n.º 1
0
        private void fillDetails()
        {
            try
            {
                DataSet ds = DBLibrary.GetStageCustomerProcess();


                ddlStage.DataSource     = ds.Tables[0];
                ddlStage.DataTextField  = "StageName";
                ddlStage.DataValueField = "StageID";
                ddlStage.DataBind();
                ddlStage.Items.Insert(0, new ListItem("ALL", "0"));
                ddlProcess.DataSource     = ds.Tables[1];
                ddlProcess.DataTextField  = "ProcessName";
                ddlProcess.DataValueField = "ProcessID";
                ddlProcess.DataBind();
                ddlProcess.Items.Insert(0, new ListItem("ALL", "0"));
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 2
0
        protected void btnupload_Click(object sender, EventArgs e)
        {
            CheckBox chkPr;
            int      count = 0;

            try
            {
                foreach (GridViewRow gvr in GVChangeProcess.Rows)
                {
                    chkPr = (CheckBox)gvr.FindControl("chkupload");
                    if (chkPr.Checked == true)
                    {
                        //int ProcessId = 1;
                        int    ID = Convert.ToInt32(GVChangeProcess.DataKeys[gvr.RowIndex].Values["ID"]);
                        string ZipDestinationpath = GVChangeProcess.DataKeys[gvr.RowIndex].Values["ZipDestinationPath"].ToString();
                        string article            = GVChangeProcess.DataKeys[gvr.RowIndex].Values["article"].ToString();
                        string Journal            = GVChangeProcess.DataKeys[gvr.RowIndex].Values["journal"].ToString();
                        string Zip     = GVChangeProcess.DataKeys[gvr.RowIndex].Values["ZipFileName"].ToString();
                        string Version = GVChangeProcess.DataKeys[gvr.RowIndex].Values["stagedisplayname"].ToString();

                        bool StatusZip = ZipUpload_FTP(ZipDestinationpath, Zip, Version);
                        if (StatusZip)
                        {
                            bool StatusReady = ReadyXMLUpload_FTP(ZipDestinationpath, Zip, Version, ID, article, Journal);
                            if (StatusReady)
                            {
                                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Upload Successful for " + Zip + "')", true);
                                chkPr.Checked = false;
                                chkPr.Enabled = true;
                            }
                        }
                        ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Not Uploaded for " + Zip + "')", true);
                        count = count + 1;
                    }
                }
                if (count > 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('All Uploades Successful')", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Select an Item To Upload')", true);
                }

                GridProcessBind();
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 3
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                //if (ddlStage.SelectedValue.ToString() == "0")
                //{
                //    ShowMessage("Please select stage");
                //    return;
                //}
                GridProcessBind();
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 4
0
        //protected string userName = "******";
        //protected string userName = Global.Validate();
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!IsPostBack)
                {
                    fillDetails();
                    btnUpdate.Visible   = false;
                    Export_Link.Visible = false;
                }
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            try
            {
                var bl       = new Business();
                var products = bl.GetProducts(); // Reference to DAL added in UI project just for demo purpose

                foreach (var p in products)
                {
                    Console.WriteLine(p.ProductName);
                }
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);
                Console.WriteLine(ex.Message);
            }

            Console.ReadLine();
        }
Ejemplo n.º 6
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            CheckBox chkPr;
            int      count = 0;

            try
            {
                foreach (GridViewRow gvr in GVChangeProcess.Rows)
                {
                    chkPr = (CheckBox)gvr.FindControl("chkChangeProcess");
                    if (chkPr.Checked == true)
                    {
                        int ProcessId = 1;
                        int ID        = Convert.ToInt32(GVChangeProcess.DataKeys[gvr.RowIndex].Values["ID"]);
                        int result    = DBLibrary.UpdateProcess(ID, ProcessId);
                        count         = count + 1;
                        chkPr.Checked = false;
                        chkPr.Enabled = true;
                    }
                }
                if (count > 0)
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Updation Successful')", true);
                }
                else
                {
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert('Select an Item To REintiate')", true);
                }

                GridProcessBind();
            }
            catch (Exception ex)
            {
                bool rethrow = false;
                rethrow = UserInterfaceExceptionHandler.HandleExcetion(ref ex);

                ShowMessage(ex.Message);
            }
        }