Ejemplo n.º 1
0
        protected void gvFileUploadSearchForNew_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                GridViewRow row     = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                int         index   = row.RowIndex;
                Guid        myRowId = Guid.Parse(gvFileUploadSearchForNew.DataKeys[index].Values[0].ToString());


                if (e.CommandName == "SoftDelete")
                {
                    MDMSVC.DC_SupplierImportFileDetails_RQ RQ = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);

                    MDMSVC.DC_SupplierImportFileDetails obj = new MDMSVC.DC_SupplierImportFileDetails
                    {
                        SupplierImportFile_Id = myRowId,
                        STATUS       = res[0].STATUS,
                        PROCESS_DATE = DateTime.Now,
                        PROCESS_USER = System.Web.HttpContext.Current.User.Identity.Name,
                        IsActive     = false
                    };

                    var result = _objMappingSVCs.UpdateSupplierStaticFileDetails(obj);
                    fillmatchingdataForNew(10, 0);

                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "File has been deleted Successfully", (BootstrapAlertType)result.StatusCode);
                }
                if (e.CommandName == "UnDelete")
                {
                    MDMSVC.DC_SupplierImportFileDetails_RQ RQ = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);
                    MDMSVC.DC_SupplierImportFileDetails obj = new MDMSVC.DC_SupplierImportFileDetails
                    {
                        SupplierImportFile_Id = myRowId,
                        STATUS       = res[0].STATUS,
                        PROCESS_DATE = DateTime.Now,
                        PROCESS_USER = System.Web.HttpContext.Current.User.Identity.Name,
                        IsActive     = true
                    };
                    var result = _objMappingSVCs.UpdateSupplierStaticFileDetails(obj);
                    fillmatchingdataForNew(10, 0);

                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "File has been un deleted Successfully", (BootstrapAlertType)result.StatusCode);
                }
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        protected void gvFileUploadSearch_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                GridViewRow row     = (GridViewRow)(((LinkButton)e.CommandSource).NamingContainer);
                int         index   = row.RowIndex;
                Guid        myRowId = Guid.Parse(gvFileUploadSearch.DataKeys[index].Values[0].ToString());

                if (e.CommandName.ToString() == "ViewDetails")
                {
                    List <MDMSVC.DC_SupplierImportFileDetails> lstobj = new List <MDMSVC.DC_SupplierImportFileDetails>();
                    MDMSVC.DC_SupplierImportFileDetails        obj    = new MDMSVC.DC_SupplierImportFileDetails();
                    MDMSVC.DC_SupplierImportFileDetails_RQ     RQ     = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    SelectedSupplierImportAttributeValue_Id = myRowId;
                    SupplierImportFile_Id    = myRowId;
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);

                    if (res != null && res.Count > 0)
                    {
                        hdnViewDetailsFlag.Value = "false";
                    }
                }
                if (e.CommandName.ToString() == "Process")
                {
                    MDMSVC.DC_SupplierImportFileDetails    obj = new MDMSVC.DC_SupplierImportFileDetails();
                    MDMSVC.DC_SupplierImportFileDetails_RQ RQ  = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    SelectedSupplierImportAttributeValue_Id = myRowId;
                    SupplierImportFile_Id    = myRowId;
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);


                    SelectedSupplierImportAttributeValue_Id = myRowId;
                    obj.SupplierImportFile_Id = res[0].SupplierImportFile_Id;
                    obj.Supplier_Id           = res[0].Supplier_Id;
                    obj.Supplier      = res[0].Supplier;
                    obj.SavedFilePath = res[0].SavedFilePath;
                    obj.PROCESS_USER  = System.Web.HttpContext.Current.User.Identity.Name;
                    obj.Entity        = res[0].Entity;
                    obj.STATUS        = res[0].STATUS;
                    obj.Mode          = res[0].Mode;
                    var result = _objMappingSVCs.StaticFileUploadProcessFile(obj);

                    fillmatchingdata(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), gvFileUploadSearch.PageIndex);

                    BootstrapAlert.BootstrapAlertMessage(dvMsg, result.StatusMessage, (BootstrapAlertType)result.StatusCode);
                }
                if (e.CommandName == "SoftDelete")
                {
                    MDMSVC.DC_SupplierImportFileDetails_RQ RQ = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);

                    MDMSVC.DC_SupplierImportFileDetails obj = new MDMSVC.DC_SupplierImportFileDetails
                    {
                        SupplierImportFile_Id = myRowId,
                        STATUS       = res[0].STATUS,
                        PROCESS_DATE = DateTime.Now,
                        PROCESS_USER = System.Web.HttpContext.Current.User.Identity.Name,
                        IsActive     = false
                    };

                    var result = _objMappingSVCs.UpdateSupplierStaticFileDetails(obj);
                    fillmatchingdata(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), 0);

                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "File has been deleted Successfully", (BootstrapAlertType)result.StatusCode);
                }
                if (e.CommandName == "UnDelete")
                {
                    MDMSVC.DC_SupplierImportFileDetails_RQ RQ = new MDMSVC.DC_SupplierImportFileDetails_RQ();
                    RQ.SupplierImportFile_Id = myRowId;
                    RQ.PageNo   = 0;
                    RQ.PageSize = int.MaxValue;
                    var res = _objMappingSVCs.GetSupplierStaticFileDetails(RQ);
                    MDMSVC.DC_SupplierImportFileDetails obj = new MDMSVC.DC_SupplierImportFileDetails
                    {
                        SupplierImportFile_Id = myRowId,
                        STATUS       = res[0].STATUS,
                        PROCESS_DATE = DateTime.Now,
                        PROCESS_USER = System.Web.HttpContext.Current.User.Identity.Name,
                        IsActive     = true
                    };
                    var result = _objMappingSVCs.UpdateSupplierStaticFileDetails(obj);
                    fillmatchingdata(Convert.ToInt32(ddlShowEntries.SelectedItem.Text), 0);

                    BootstrapAlert.BootstrapAlertMessage(dvMsg, "File has been un deleted Successfully", (BootstrapAlertType)result.StatusCode);
                }
            }
            catch
            {
            }
        }