Пример #1
0
        protected void ASPxGridView1_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            // DatasourcesCachesInvalidate(DataSourceMaster.CacheKeyDependency);
            // DatasourcesCachesInvalidate(DataSourceDetail.CacheKeyDependency);

            var grid    = (sender as ASPxGridView);
            var datasrc = FindControlRecursive(grid.DataSourceID) as SqlDataSource;

            DatasourcesCachesInvalidate(datasrc.CacheKeyDependency);

            // TODO: BUG not raising events...
            // TODO: use name in database (ContentType)

            string contentType   = string.Empty;
            string contentTypeID = e.NewValues["ContentTypeID"].ToString();
            string category      = e.NewValues["Category"].ToString();
            string subCategory   = e.NewValues["SubCategory"].ToString();
            string title         = e.NewValues["Title"].ToString();


            if (contentTypeID == "8")
            {
                contentType = "Productos";
            }
            if (contentTypeID == "9")
            {
                contentType = "Servicios";
            }
            if (contentTypeID == "10")
            {
                contentType = "Recursos";
            }
            if (contentTypeID == "11")
            {
                contentType = "Aplicaciones";
            }
            if (contentTypeID == "12")
            {
                contentType = "Industrias";
            }

            if (!string.IsNullOrEmpty(contentType) &&
                !string.IsNullOrEmpty(category) &&
                !string.IsNullOrEmpty(subCategory) &&
                !string.IsNullOrEmpty(title)
                )
            {
                string imgDir  = Server.MapPath("~/Content/Img/" + contentType + "/" + category + "/" + subCategory + "/" + title);
                string fileDir = Server.MapPath("~/Content/Files/" + contentType + "/" + category + "/" + subCategory + "/" + title);

                if (!Directory.Exists(imgDir))
                {
                    _ = Directory.CreateDirectory(imgDir);
                }
                if (!Directory.Exists(fileDir))
                {
                    _ = Directory.CreateDirectory(fileDir);
                }
            }
        }
Пример #2
0
    protected void master_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        string newValue = e.NewValues["CategoryID"].ToString();

        master.MakeRowVisible(newValue);
        master.DetailRows.ExpandRowByKey(Convert.ToInt32(newValue));
    }
Пример #3
0
 protected void ASPxGridView1_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     XPQuery <BookingEntry> BookingEntryQuery = session.Query <BookingEntry>();
     BookingEntry           BkE       = session.GetObjectByKey <BookingEntry>(Guid.Parse(Session["BookingEntryId"].ToString()));
     AccountingBO           accountBO = new AccountingBO();
     Guid trnId = accountBO.CreateBookingEntryTransaction(session, BkE.BookingEntryId);
 }
Пример #4
0
    protected void grid_Cost_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        ASPxPageControl pageControl = this.grid_ref.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
        ASPxTextBox     refNo       = pageControl.FindControl("txt_RefN") as ASPxTextBox;

        UpdateEstAmt(refNo.Text);
    }
Пример #5
0
 protected void gv_ProductSeries_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     //Session.Remove("SeriesCode");
     //Session.Remove("SeriesName");
     //Session.Remove("ProductCategory");
     //Session.Remove("SeriesImage");
 }
Пример #6
0
    protected void grid_InvDet_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        ASPxTextBox docId = this.ASPxGridView1.FindEditFormTemplateControl("txt_Oid") as ASPxTextBox;
        int         invId = SafeValue.SafeInt(e.NewValues["InvId"], 0);

        UpdateMaster(SafeValue.SafeInt(docId.Text, 0));
    }
Пример #7
0
        protected void grdBalanceLine_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            if (cboBalanceInitAccount.Value == null || cboBalanceInitCurrency.Value == null)
            {
                return;
            }

            ObjectBO objectBO = new ObjectBO();

            NAS.DAL.CMS.ObjectDocument.Object debitJounalCMSObject = objectBO.CreateCMSObject(session, ObjectTypeEnum.OPENBALANCE_ACCOUTING);

            GeneralJournal debitGeneralJournal = session.GetObjectByKey <GeneralJournal>(Guid.Parse(e.NewValues["GeneralJournalId"].ToString()));

            GeneralJournalObject debitGeneralJournalObject = null;

            debitGeneralJournalObject = new GeneralJournalObject(session);
            debitGeneralJournalObject.GeneralJournalId = debitGeneralJournal;
            debitGeneralJournalObject.ObjectId         = debitJounalCMSObject;
            debitGeneralJournalObject.Save();

            ObjectType objectType = NAS.DAL.CMS.ObjectDocument.ObjectType.GetDefault(session, ObjectTypeEnum.OPENBALANCE_ACCOUTING);

            GeneralJournalCustomType generalJournalCustomType = new GeneralJournalCustomType(session);

            generalJournalCustomType.GeneralJournalId = debitGeneralJournal;
            generalJournalCustomType.ObjectTypeId     = objectType;
            generalJournalCustomType.Save();

            grdBalanceLine.JSProperties.Add("cpRefreshTree", "refresh");
        }
Пример #8
0
    protected void dxgrdcartons_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        if (e.AffectedRecords != 0)
        {
            string _tr = wwi_func.get_from_global_resx("html_table_tr");
            string _tb = wwi_func.get_from_global_resx("html_table_body");
            string _tx = "";

            //string _key = (sender as ASPxGridView).GetMasterRowKeyValue().ToString();
            //use order ref from session if it's there, if not just have to use title id
            string _key = Session["selPAOrderId"] != null ? Session["selPAOrderId"].ToString() : "";
            //int _titleid = wwi_func.vint((sender as ASPxGridView).GetMasterRowKeyValue().ToString());
            //int _cartons = wwi_func.vint(e.NewValues["cartons"].ToString());

            _tx += string.Format(_tr, "CartonLength", e.NewValues["CartonLength"].ToString(), "");
            _tx += string.Format(_tr, "CartonWidth", e.NewValues["CartonWidth"].ToString(), "");
            _tx += string.Format(_tr, "CartonHeight", e.NewValues["CartonHeight"].ToString(), "");
            _tx += string.Format(_tr, "CartonWeight", e.NewValues["CartonWeight"].ToString(), "");
            _tx  = string.Format(_tb, _tx);

            set_tally(wwi_func.vint(_key), +1, "cartons");
            //set_tally_cartons(_key, get_tally_cartons(_titleid));
            send_advance_email(_key.ToString(), "carton added", "A new carton has been added: " + Environment.NewLine + _tx);
        }
    }
Пример #9
0
 protected void gvxOpperation_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     // insert materials
     try
     {
         int opperationID                       = int.Parse(ViewState ["OpperatioinID"].ToString());
         ASPxDropDownEdit          dd           = (ASPxDropDownEdit)gvxOpperation.FindEditFormTemplateControl("ddMaterails");
         ASPxCheckBoxList          list         = (ASPxCheckBoxList)dd.FindControl("chlMaterails");
         List <OpperationMaterial> opperMatList = new List <OpperationMaterial>();
         foreach (ListEditItem item in list.Items)
         {
             if (item.Selected)
             {
                 opperMatList.Add(new OpperationMaterial()
                 {
                     OpperationID = opperationID, ItemID = int.Parse(item.Value.ToString())
                 });
             }
         }
         OpperationMaterialsRepository oppRepository = new OpperationMaterialsRepository();
         bool result = oppRepository.AddMaterialForOpperations(opperMatList);
     }
     catch (Exception)
     {
     }
 }
Пример #10
0
    protected void grid_det_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        ASPxPageControl pageControl = this.grid.FindEditFormTemplateControl("pageControl") as ASPxPageControl;
        ASPxTextBox     oidCtr      = pageControl.FindControl("txt_SoNo") as ASPxTextBox;

        UpdateMaster(oidCtr.Text);
    }
Пример #11
0
    protected void grid_det_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        int    id      = SafeValue.SafeInt(e.NewValues["Id"], 0);
        string poNo    = SafeValue.SafeString(e.NewValues["SoNo"]);
        string product = SafeValue.SafeString(e.NewValues["Product"]);

        UpdateMaster(id, 0, poNo, product);
    }
Пример #12
0
 protected void grid_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     //if (e.Exception == null)
     //{
     //    Session["AirPort"] = "AirCode='" + e.NewValues["AirCode"] + "'";
     //    this.dsThePort.FilterExpression = "AirCode='" + e.NewValues["AirCode"] + "'";
     //}
 }
Пример #13
0
 protected void ASPxGridView1_Inserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     //if (e.Exception == null)
     //{
     //    string role = e.NewValues["Code"].ToString();
     //    InsertMenu(role);
     //}
 }
Пример #14
0
    protected void grid_wh_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        string sql = string.Format(@"select top 1 Id from job_house order by Id desc");
        int    id  = SafeValue.SafeInt(ConnectSql.ExecuteScalar(sql), 0);

        sql = string.Format(@"update job_house set LineId={0} where Id={0}", id);
        ConnectSql.ExecuteSql(sql);
    }
Пример #15
0
 protected void grid_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     if (e.Exception == null)
     {
         //Session["LeaveType"] = "Code='" + e.NewValues["Code"] + "'";
         //this.dsHrMastData.FilterExpression = "Code='" + e.NewValues["Code"] + "'";
     }
 }
Пример #16
0
 protected void grid_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     if (e.Exception == null)
     {
         Session["City"] = "Code='" + e.NewValues["Code"] + "'";
         this.dsCity.FilterExpression = "Code='" + e.NewValues["Code"] + "'";
     }
 }
Пример #17
0
    protected void grid_PORDet_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        int    lineNo  = SafeValue.SafeInt(e.NewValues["Id"], 0);
        int    qty     = SafeValue.SafeInt(e.NewValues["Qty"], 0);
        string poNo    = SafeValue.SafeString(e.NewValues["PoNo"]);
        string product = SafeValue.SafeString(e.NewValues["Product"]);

        UpdateMaster(lineNo, qty, poNo, product);
    }
        protected void DeliveryGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            List <Treatment_Delivery> List     = db.Treatment_Delivery.ToList();
            Treatment_Delivery        Delivery = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(Delivery, logFileModule.settings);
            logFileModule.logfile(10, "اضافة حالة تسليم جديدة", "add treatment delivery", LogData);
        }
Пример #19
0
        protected void ASPxGridView1_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            // DatasourcesCachesInvalidate(DataSourceMaster.CacheKeyDependency);
            // DatasourcesCachesInvalidate(DataSourceDetail.CacheKeyDependency);

            var grid    = (sender as ASPxGridView);
            var datasrc = FindControlRecursive(grid.DataSourceID) as SqlDataSource;

            DatasourcesCachesInvalidate(datasrc.CacheKeyDependency);
        }
Пример #20
0
        protected void treelstProductUnits_NodeInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            ItemUnitRelationType itemUnitRelationType = session.FindObject <ItemUnitRelationType>(new BinaryOperator("Name", "UNIT", BinaryOperatorType.Equal));

            if (itemUnitRelationType == null)
            {
                throw new Exception("The key is not exist in ItemUnitRelationType");
            }
            e.NewValues["ItemUnitRelationTypeId!Key"] = itemUnitRelationType.ItemUnitRelationTypeId;
        }
        protected void ConfidentialityGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            List <Treatment_Confidentiality> List            = db.Treatment_Confidentiality.ToList();
            Treatment_Confidentiality        Confidentiality = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(Confidentiality, logFileModule.settings);
            logFileModule.logfile(10, "اضافة درجة سرية", "add a secret level", LogData);
        }
        protected void PriorityGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            List <Treatment_Priority> List     = db.Treatment_Priority.ToList();
            Treatment_Priority        Priority = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(Priority, logFileModule.settings);
            logFileModule.logfile(10, "اضافة اولوية جديدة", "add a new priority", LogData);
        }
        protected void ClassGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            List <Treatment_Class> List  = db.Treatment_Class.ToList();
            Treatment_Class        Class = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(Class, logFileModule.settings);
            logFileModule.logfile(10, "اضافة تصنيف جديد", "add treatment class", LogData);
        }
        protected void ProcedureGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            List <Treatment_Procedure> List      = db.Treatment_Procedure.ToList();
            Treatment_Procedure        Procedure = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(Procedure, logFileModule.settings);
            logFileModule.logfile(10, "اضافة اجراء جديد", "add treatment procedure", LogData);
        }
Пример #25
0
 protected void ASPxGridViewAusentismos_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
 {
     if (e.Exception == null)
     {
         ((ASPxGridView)sender).JSProperties["cp_success"] = "true";
     }
     else
     {
         ((ASPxGridView)sender).JSProperties["cp_success"] = "false";
     }
 }
Пример #26
0
    protected void dxgrdtitles_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        if (e.AffectedRecords != 0)
        {
            string _key   = (sender as ASPxGridView).GetMasterRowKeyValue().ToString();
            string _title = e.NewValues["Title"].ToString();

            set_tally(wwi_func.vint(_key), +1, "titles");
            send_advance_email(_key.ToString(), "title added", "A new title has been added: " + Environment.NewLine + _title);
        }
    }
Пример #27
0
        protected void gvMain_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            //get priority
            GridViewDataComboBoxColumn column = gvMain.Columns["PriorityID"] as GridViewDataComboBoxColumn;
            string priority = column.PropertiesComboBox.Items.FindByValue(e.NewValues["PriorityID"]).Text;
            //get last id
            string sql   = "SELECT MAX(ID) FROM base_ticket";
            string MAXID = DataBase.GetDT(sql).Rows[0][0].ToString();

            //update when and who created
            sql = "UPDATE base_ticket SET DateOpen = @DateOpen, OpenBy = @OpenBy WHERE (ID = @ID)";
            List <SqlParameter> sp = new List <SqlParameter>()
            {
                new SqlParameter()
                {
                    ParameterName = "@DateOpen", SqlDbType = SqlDbType.Date, Value = DateTime.Today.ToShortDateString()
                },
                new SqlParameter()
                {
                    ParameterName = "@OpenBy", SqlDbType = SqlDbType.NVarChar, Value = User.Identity.Name
                },
                new SqlParameter()
                {
                    ParameterName = "@ID", SqlDbType = SqlDbType.Int, Value = MAXID
                }
            };

            DataBase.UpdateDB(sp, sql);

            //send email to executive team
            gvMain.JSProperties["cpMessage"] = "Email sent to Amerinode Support at [email protected] for immediate processing.";
            Notifications.add("Q Ticket has been created", "<b>Q Ticket # " + MAXID + "</b> has just been created in Q by " + User.Identity.Name + ".<br/>"
                              + "Login into Q and change its Status to PROCEED as an authorization for IT to proceed with implementation.<br/>"
                              + "Description: " + e.NewValues["Description"].ToString() + "<br/>"
                              + "Priority: " + priority + "<br/>"
                              + "Customer Impacting: " + e.NewValues["CustomerImpacting"].ToString()
                              , "*****@*****.**", "*****@*****.**", -1);
            //re-enable columns
            gvMain.Columns["StatusID"].Visible      = true;
            gvMain.Columns["DateOpen"].Visible      = true;
            gvMain.Columns["DateClose"].Visible     = true;
            gvMain.Columns["OpenBy"].Visible        = true;
            gvMain.Columns["CloseBy"].Visible       = true;
            gvMain.Columns["ApprovedBy"].Visible    = true;
            gvMain.Columns["QVersion"].Visible      = true;
            gvMain.Columns["Resolution"].Visible    = true;
            gvMain.Columns["CloseApproved"].Visible = true;
            gvMain.Columns["Files"].Visible         = true;
            if (Session["tempDir"] != null)
            {
                changePath(MAXID);
            }
        }
Пример #28
0
        protected void LanguageGridView_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            db.Configuration.LazyLoadingEnabled = false;
            // Selecet Language Based on User language and set in session
            SessionWrapper.Language = db.Lanuage_Detials.Where(x => x.Language_Master_ID == SessionWrapper.LoggedUser.Language_id).ToList();

            List <Lanuage_Detials> List = db.Lanuage_Detials.ToList();
            Lanuage_Detials        lang = List[List.Count - 1];

            /*Add it to log file */
            LogData = "data:" + JsonConvert.SerializeObject(lang, logFileModule.settings);
            logFileModule.logfile(10, " اضافة ترجمة جديدة", "Add a new translation", LogData);
        }
Пример #29
0
        protected void grdBooking_RowInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
        {
            grdBooking.Selection.SelectRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString()));

            grdBooking.DetailRows.CollapseAllRows();
            grdBooking.DetailRows.ExpandRowByKey(Guid.Parse(e.NewValues["TransactionId"].ToString()));

            int          position          = grdBooking.FindVisibleIndexByKeyValue(Guid.Parse(e.NewValues["TransactionId"].ToString()));
            ASPxGridView grdBooking_Detail = (ASPxGridView)grdBooking.FindDetailRowTemplateControl(position, "grdBookingDetail");

            grdBooking_Detail.AddNewRow();
            grdBooking_Detail.Focus();


            grdBooking.FocusedRowIndex = position;
        }
Пример #30
0
    protected void ASPxCardView1_CardInserted(object sender, DevExpress.Web.Data.ASPxDataInsertedEventArgs e)
    {
        object newKey = null;

        if (e.AffectedRecords == 1)
        {
            ICollection objects = uof.GetObjectsToSave();
            if (objects != null && objects.Count == 1)
            {
                IEnumerator enumeration = objects.GetEnumerator();
                enumeration.MoveNext();
                Customer obj = (Customer)enumeration.Current;
                uof.CommitChanges();
                newKey = obj.Oid;
            }
        }
        ASPxCardView1.FocusedCardIndex = ASPxCardView1.FindVisibleIndexByKeyValue(newKey);
    }