Пример #1
0
    public bool SaveMenifest()
    {
        tblManifest objMenifest = new tblManifest();
        string      strError    = "";

        if (objMenifest.LoadByPrimaryKey(Convert.ToInt32(txtMenifestNo.Text)))
        {
            //if (objMenifest.s_AppUploadedManifest == "")
            //{
            objClsCommon = new clsCommon();
            string Time    = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second);
            string strPath = objClsCommon.FileUpload_Images(FileUploadMenifest.PostedFile, txtMenifestNo.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Menifest/", ref strError, 0, objMenifest.s_AppUploadedManifest, false, 0, 2000);
            if (strError == "")
            {
                objMenifest.AppUploadedManifest = strPath;
            }
            else
            {
                DInfo.ShowMessage(strError, Enums.MessageType.Error);
                return(false);
            }
            objMenifest.Save();
            objClsCommon = null;
            //}
            //else { DInfo.ShowMessage("Menifest not exists.", Enums.MessageType.Error); }
        }
        else
        {
            DInfo.ShowMessage("Enter valid Menifest Number", Enums.MessageType.Error);
        }
        resetMenifestForm();

        objMenifest = null;
        return(true);
    }
Пример #2
0
    protected void dgvGridView_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e)
    {
        if (!string.IsNullOrEmpty(e.CommandArgument.ToString()))
        {
            if (e.CommandName == "SaveFile")
            {
                GridViewRow gvRow   = (GridViewRow)((Control)e.CommandSource).NamingContainer;
                Int32       rowind  = gvRow.RowIndex;
                FileUpload  FileImg = (FileUpload)gvRow.FindControl("fileUpload");
                if (FileImg.HasFile)
                {
                    tblManifest objMenifest = new tblManifest();

                    if (objMenifest.LoadByPrimaryKey(Convert.ToInt32(e.CommandArgument.ToString())))
                    {
                        if (objMenifest.s_AppUploadedManifest == "")
                        {
                            objCommon = new clsCommon();
                            string strError = "";
                            string Time     = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second);
                            string strPath  = objCommon.FileUpload_Images(FileImg.PostedFile, objMenifest.s_AppManifestID.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Menifest/", ref strError, 0, objMenifest.s_AppUploadedManifest, false, 0, 2000);
                            if (strError == "")
                            {
                                objMenifest.AppUploadedManifest = strPath;
                            }
                            else
                            {
                                DInfo.ShowMessage(strError, Enums.MessageType.Error);
                                return;
                            }
                            objMenifest.Save();
                            objCommon = null;
                        }
                        else
                        {
                            DInfo.ShowMessage("Menifest not exists.", Enums.MessageType.Error);
                        }
                    }
                    else
                    {
                        DInfo.ShowMessage("Enter valid Menifest Number.", Enums.MessageType.Error);
                    }
                    objMenifest = null;
                    LoadDataGrid(true, false);
                }
                else
                {
                    DInfo.ShowMessage("Select Manifest File.", Enums.MessageType.Error);
                }
            }
        }
    }
    protected void Page_Load(object sender, System.EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if ((Request.QueryString.Get("ID") != null))
            {
                string strId = "";
                objEncrypt = new clsEncryption();
                try
                {
                    // strId = objEncrypt.Decrypt(Request.QueryString.Get("ID"), appFunctions.strKey);
                    strId = Request.QueryString.Get("ID");
                    // string strCourierComapnyId = objEncrypt.Decrypt(Request.QueryString.Get("CID"), appFunctions.strKey);
                    if (strId != "")
                    {
                        objSubOrder            = new tblSubOrder();
                        objDataTable           = objSubOrder.GetSubOrderListMainfest(strId.TrimEnd(',').Trim(), Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString());
                        dgvGridView.DataSource = null;
                        dgvGridView.DataBind();
                        if (objDataTable.Rows.Count > 0)
                        {
                            objMenifest = new tblManifest();
                            objMenifest.AddNew();
                            // objMenifest.AppSellerID = Convert.ToInt32(Session[appFunctions.Session.SellerID.ToString()]);
                            objMenifest.AppCreatedDate = GetDateTime();
                            objMenifest.Save();
                            iMenifestID = objMenifest.AppManifestID;
                            objMenifest = null;

                            printButton.Visible = true;
                            lblSiteName.Text    = appFunctions.strAppname.ToString() + " (ID-" + iMenifestID.ToString() + ")";
                            lblSellerName.Text  = appFunctions.strSellerName.ToString();
                            // spanMenifestNo.InnerHtml = iMenifestID.ToString();
                            //  spanProviderName.InnerHtml = objDataTable.Rows[0][tblCourierCompany.ColumnNames.AppCourierCompany].ToString();
                            if (objDataTable.Rows[0]["appSelfCourier"].ToString() != "")
                            {
                                lblCourierComp.Text = ((Enums.Enum_CourierCompany) int.Parse(objDataTable.Rows[0]["appSelfCourier"].ToString())).ToString();
                            }
                            spanPackage.InnerHtml = objDataTable.Rows.Count.ToString();
                            objSubOrder.SetSubOrderMenifest(strId.TrimEnd(',').Trim(), iMenifestID, Convert.ToInt32(Enums.Enums_OrderStatus.ReadyToShip).ToString());
                            divlbl.Visible = true;
                        }
                        else
                        {
                            printButton.Visible = false;
                            divlbl.Visible      = false;
                        }
                        dgvGridView.DataSource = objDataTable;
                        dgvGridView.DataBind();
                        objSubOrder = null;
                    }
                    else
                    {
                        printButton.Visible = false;
                    }
                }
                catch (Exception ex)
                {
                }
                objEncrypt = null;
            }
        }
    }