Example #1
0
 /// <summary>
 /// 查询完WebService之后更新记录表
 /// </summary>
 /// <param name="cq">记录表对象</param>
 /// <param name="msg">查询之后的消息</param>
 private void ChangeQueryRecordStatu(BLL.Request.Request cq, string msg)
 {
     Model.QueryRecoder queryRecoder = cq.QueryRecoderModel;
     int queryDateInterval = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["QueryDateInterval"].Trim());
     if (queryRecoder != null)
     {
         try
         {
             if ((DateTime.Now - queryRecoder.AddDate).Days > queryDateInterval)
             {
                 //超时数据
                 queryRecoder.LastQueryDate = DateTime.Now;
                 queryRecoder.IsDel = true;
             }
             else
             {
                 //不超时数据
                 queryRecoder.LastQueryDate = DateTime.Now;
             }
             queryRecoder.QueryResult = ("&nbsp" + DateTime.Now.ToLocalTime() + " " + msg + queryRecoder.QueryResult);
             QueryRecoder q = new QueryRecoder();
             q.Update(queryRecoder);
         }
         catch (Exception ex)
         {
             Common.LogHelper.WriteError(ex);
         }
     }
 }
Example #2
0
 public void Add(BLL.GroupRole role)
 {
     string[] names = role.RoleName.Split('_');
     if (names.Length > 1)
     {
         switch (names[1].ToLower())
         {
             case "add":
                 AddRole = role;
                 break;
             case "edit":
                 EditRole = role;
                 break;
             case "delete":
                 DeleteRole = role;
                 break;
             case "view":
                 ViewRole = role;
                 break;
             case "reports":
                 ReportsRole = role;
                 break;
         }
     }
 }
Example #3
0
 public void ConfigureContext(BLL.Models.CrawlerDB crawlerDB)
 {
     crawlerDB.Configuration.ProxyCreationEnabled = false;
     crawlerDB.Configuration.AutoDetectChangesEnabled = false;
     crawlerDB.Configuration.ValidateOnSaveEnabled = false;
     crawlerDB.Configuration.ProxyCreationEnabled = false;
 }
 public CurrentUserModel(BLL.UserProfile user)
 {
     this.Owner = user.DefaultHub.HubOwner.Name;
     this.Name = user.DefaultHub.Name;
     this.DefaultHubId = user.DefaultHub.HubID;
     PossibleHubs = user.UserAllowedHubs;
 }
        public void CreateDetailTransactionsForErrorCorrection(Order order, BLL.PickList picklist,
                                        Issue stvLog, int receiptPalletId, int receiptID, User user, DateTime convertedEthDate
                                        , int newItemId, int newUnitId, int newManufacturerId, decimal pickedPack
                                        , decimal Convertedpack, int confirmationStatusId, bool changeExpiryDate
                                        , DateTime? ExpiryDate, bool changeBatchNo, string batchNo)
        {
            //Load the ReceivePallet First From that we Get the Information that We need
            ReceivePallet receivePalletOriginal = new ReceivePallet();
            receivePalletOriginal.LoadByPrimaryKey(receiptPalletId);

            ReceiveDoc receiveDocOriginal = new ReceiveDoc();
            receiveDocOriginal.LoadByPrimaryKey(receivePalletOriginal.ReceiveID);

            //Load ItemUnit Detail for For ItemUnit Change;
            ItemUnit newItemUnit = new ItemUnit();
            newItemUnit.LoadByPrimaryKey(newUnitId);

              // Generate PicklistDetail With OrderDetail information
            PickListService pickListService = new PickListService();
            PickListDetail pickListDetail = pickListService.CreatePicklistDetailWithOrder(receiveDocOriginal, receivePalletOriginal, order, picklist,
                                                          pickedPack);
            // Generate IssueDoc from picklistDetail and substract the quantity from receiveDoc
            IssueService issueService = new IssueService();
            issueService.CreateIssueFromPicklist(pickListDetail, order, convertedEthDate, stvLog, user);

            if (Convertedpack > 0)
            {
                //duplicate The ReceiveDoc and ReceiptPallet
                ReceiveService receiveService = new ReceiveService();
                receiveService.CloneReceiveForErrorCorrection(confirmationStatusId, receivePalletOriginal, receiveDocOriginal
                                                                , Convertedpack, user, newItemId
                                                                , receiveDocOriginal.StoreID, receiptID
                                                                , newManufacturerId, newItemUnit, convertedEthDate,changeExpiryDate,ExpiryDate,changeBatchNo,batchNo);
            }
        }
 public void Add(BLL.BusinessObjects.UITemplate entity)
 {
     using (_UITemplateRepository = new GenericRepository<DAL.DataEntities.UITemplate>())
     {
         _UITemplateRepository.Add((DAL.DataEntities.UITemplate)entity.InnerEntity);
         _UITemplateRepository.SaveChanges();
     }
 }
Example #7
0
 private void CallSearchEvent(BLL.SearchItem Search)
 {
     // Event will be null if there are no subscribers
     if (SearchSelectEvent != null)
     {
         SearchSelectEvent(Search);
     }
 }
Example #8
0
        public void SetDay(BLL.CalendarDay day)
        {
            lbl_Date.Content = day.Date.ToString("dddd, MMMM d yyyy");

            txbl_EventList.Text = "";

            ListEvents(day.Events);
        }
Example #9
0
 private void CallBookmarkEvent(BLL.BookmarkExt Bookmark)
 {
     // Event will be null if there are no subscribers
     if (BookmarkSelectEvent != null)
     {
         BookmarkSelectEvent(Bookmark);
     }
 }
Example #10
0
 private void CallContentEvent(BLL.HadithContentExt Content,int Index)
 {
     // Event will be null if there are no subscribers
     if (ContentSelectEvent != null)
     {
         ContentSelectEvent(Content,Index);
     }
 }
Example #11
0
 private void CallJuzEvent(BLL.quran_data.JuzData Juz)
 {
     // Event will be null if there are no subscribers
     if (JuzSelectEvent != null)
     {
         JuzSelectEvent(Juz);
     }
 }
Example #12
0
 public SQLServerBase(BLL.ConnectionStringHelper connectionString)
 {
     _connectionString = connectionString;
     _serverName = connectionString.ServerName;
     _databaseName = connectionString.DatabaseName;
     _userName = connectionString.UserName;
     _password = connectionString.Password;
 }
Example #13
0
 public BLL.Model.Entity.Head Insert(BLL.Model.Entity.Head entity)
 {
     DALHead dalhead = GetDALHead(entity);
     _db.AddToHeads(dalhead);
     _db.SaveChanges();
     entity.Id = dalhead.ID;
     return entity;
 }
Example #14
0
        public ActionResult Index(BLL.Models.User user)
        {
            if (ModelState.IsValid)
            {
                ModelState.AddModelError("PseudoOk", T4ResX.Sample.Localization.Models.User.PseudoOk);
            }

            return View(user);
        }
Example #15
0
 public string Save(BLL.gigade.Model.OrderSlave orderSlave)
 {
     orderSlave.Replace4MySQL();
     StringBuilder strSql = new StringBuilder("insert into order_slave(`slave_id`,`order_id`,`vendor_id`,`slave_product_subtotal`,`slave_amount`,");
     strSql.Append("`slave_status`,`slave_note`,`slave_ipfrom`)values({0},{1},");
     strSql.AppendFormat("{0},{1},", orderSlave.Vendor_Id, orderSlave.Slave_Product_Subtotal);
     strSql.AppendFormat("{0},{1},'{2}','{3}')", orderSlave.Slave_Amount, orderSlave.Slave_Status, orderSlave.Slave_Note, orderSlave.Slave_Ipfrom);
     return strSql.ToString();
 }
Example #16
0
        public static void Start(List<ReceiptItem> receiptItems, List<Reward> eligibleRewards)
        {
            PrintInput(receiptItems, eligibleRewards);

            BLL bll = new BLL(receiptItems, eligibleRewards);
            PayLoad bestRewards = bll.Run();

            PrintOutput(bestRewards);
        }
Example #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FieldChange"/> class.
        /// </summary>
        /// <param name="audit">The audit.</param>
        /// <param name="proprtyName">Name of the proprty.</param>
        public FieldChange(BLL.Audit audit, string proprtyName)
        {
            //  this.ChangeDate = audit.DateTime;
            BLL.UserProfile user = BLL.UserProfile.GetUserById(audit.LoginID);
            this.ChangedBy = (user != null) ? user.UserName : "******";
            this.FieldName = proprtyName;

            this.PreviousValue = audit.OldValue;
            this.ChangedValue = audit.NewValue;
        }
 public static void Log(BLL.Issue issue,BLL.Receipt receipt,decimal conversionfactor)
 {
     var errorCorrection = new ErrorCorrection();
     errorCorrection.AddNew();
     errorCorrection.UserID = CurrentContext.LoggedInUser.ID;
     errorCorrection.IssueID = issue.ID;
     errorCorrection.ReceiptID = receipt.ID;
     errorCorrection.ConversionFactor = conversionfactor;
     errorCorrection.Save();
 }
Example #19
0
 public bool Update(BLL.Model.Entity.Head entity)
 {
     DALHead dalHead = GetDALHead(entity.Name);
     if (dalHead == null) return false;
     //dalHead.Name = entity.Name;
     dalHead.Type = entity.Type.ToString();
     dalHead.Description = entity.Description;
     dalHead.IsActive = entity.IsActive;
     return _db.SaveChanges() > 0;
 }
Example #20
0
        public string SaveUserLife(BLL.gigade.Model.UserLife model)
        {
            model.Replace4MySQL();
            StringBuilder sql = new StringBuilder();

            sql.AppendFormat(@"insert into user_life (user_id,info_type, info_code,info_name,remark,kdate,kuser) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}');",
                model.user_id, model.info_type, model.info_code, model.info_name, model.remark, model.kdate, model.kuser);

            return sql.ToString();
        }
 public string Delete(BLL.gigade.Model.ProductStatusHistory history)
 {
     try
     {
         return _historyDao.Delete(history);
     }
     catch (Exception ex)
     {
         throw new Exception("ProductStatusHistoryMgr-->Delete" + ex.Message, ex);
     }
 }
 public int UpdateColumn(BLL.gigade.Model.ProductStatusHistory save)
 {
     try
     {
         return _historyDao.UpdateColumn(save);
     }
     catch (Exception ex)
     {
         throw new Exception("ProductStatusHistoryMgr-->UpdateColumn" + ex.Message, ex);
     }
 }
 public string SaveNoProductId(BLL.gigade.Model.ProductStatusHistory save)
 {
     try
     {
         return _historyDao.SaveNoProductId(save);
     }
     catch (Exception ex)
     {
         throw new Exception("ProductStatusHistoryMgr-->SaveNoProductId" + ex.Message, ex);
     }
 }
        public void ShowDay(BLL.CalendarDay day)
        {
            currentDay = day;
            lbl_Date.Content = day.Date.ToString("MMMM d yyyy");

            UpdateEvents();

            txbl_EditButtonText.Text = "Edit";
            grd_EditEvent.Height = 0;
            grd_CreateEvent.Height = 0;
        }
Example #25
0
 public List<BLL.gigade.Model.ChannelOrder> Query(BLL.gigade.Model.ChannelOrder query)
 {
     try
     {
         return _channelOrderDao.Query(query);
     }
     catch (Exception ex)
     {
         throw new Exception("ChannelOrderMgr-->Query-->" + ex.Message, ex);
     }
     
 }
 public string Delete(BLL.gigade.Model.ProductStatusHistory history)
 {
     try
     {
         StringBuilder strSql = new StringBuilder("set sql_safe_updates = 0;delete from product_status_history ");
         strSql.AppendFormat("where product_id={0};set sql_safe_updates = 1;", history.product_id);
         return strSql.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception("ProductStatusHistoryDao.Delete-->" + ex.Message, ex);
     }
 }
Example #27
0
        public static string[] GetDatabases(string serverName, string userName, string password, BLL.ConnectionStringHelper.DatabaseTypes dbType, bool trustedConnection)
        {
            List<string> databaseNames = new List<string>();

            Microsoft.SqlServer.Management.Smo.Server server = new Server(new ServerConnection(serverName, userName, password));

            foreach (Microsoft.SqlServer.Management.Smo.Database database in server.Databases)
            {
                databaseNames.Add(database.Name);
            }

            return (string[])databaseNames.ToArray();
        }
Example #28
0
        public static string[] GetDatabases(string serverName, string userName, string password, BLL.ConnectionStringHelper.DatabaseTypes dbType, bool trustedConnection)
        {
            List<string> databases = new List<string>();

            SQLDMO.SQLServer sqlServer = new SQLServerClass();
            sqlServer.Connect(serverName, userName, password);

            foreach (SQLDMO.Database database in sqlServer.Databases)
            {
                databases.Add(database.Name);
            }

            return (string[])databases.ToArray();
        }
 public string SaveNoProductId(BLL.gigade.Model.ProductStatusHistory save)
 {
     try
     {
         save.Replace4MySQL();
         StringBuilder stb = new StringBuilder("set sql_safe_updates = 0; insert into product_status_history (`product_id`,`user_id`,`create_time`,`type`,`product_status`,`remark`) values ({0}");
         stb.AppendFormat(",{0},now(),{1},{2},'{3}');set sql_safe_updates = 1;", save.user_id, save.type, save.product_status, save.remark);
         return stb.ToString();
     }
     catch (Exception ex)
     {
         throw new Exception("ProductStatusHistoryDao.SaveNoProductId-->" + ex.Message, ex);
     }
 }
Example #30
0
 public static IDAL.IView CreateView(DatabaseTypes dalAssemblyName, BLL.ConnectionStringHelper connectionString)
 {
     switch (dalAssemblyName)
     {
         case DatabaseTypes.SQLServer2000:
             return new SQLServerDAL_2005.View(connectionString);
         case DatabaseTypes.SQLServer2005:
             return new SQLServerDAL_2005.View(connectionString);
         case DatabaseTypes.SQLServerExpress:
             return new SQLServerDAL_Express.View(connectionString);
         default:
             throw new NotImplementedException("Not handled yet: " + dalAssemblyName);
     }
 }
Example #31
0
        private void Acc_Document_Show()
        {
            //جهت صدور سند حسابداری برای انبار
            stp_acc_document_selResult                DocumentRecord = new stp_acc_document_selResult();
            stp_acc_document_article_selResult        acc_document_article_inv_store       = new stp_acc_document_article_selResult();
            stp_acc_document_article_selResult        acc_document_article_inv_destination = new stp_acc_document_article_selResult();
            List <stp_acc_document_article_selResult> LstDocumentArticle = new List <stp_acc_document_article_selResult>();

            DocumentRecord.acc_document_description    = " سند حسابداری اسناد انبار تا تاریخ " + selectedRecord.acc_document_date;
            DocumentRecord.acc_document_from_inventory = true;
            List <stp_inv_store_selResult> lstStore = new List <stp_inv_store_selResult>();
            stp_inv_store_selResult        invStore = new stp_inv_store_selResult();

            lstStore = new BLL <stp_inv_store_selResult>().GetAllRecords_DB();
            stp_acc_chart_account_selResult        accChartAccountInvStore       = new stp_acc_chart_account_selResult();
            stp_acc_chart_account_treResult        accChartAccount               = new stp_acc_chart_account_treResult();
            stp_acc_chart_account_selResult        accChartAccountInvDestination = new stp_acc_chart_account_selResult();
            List <stp_acc_chart_account_treResult> lstAccChartAccount            = new List <stp_acc_chart_account_treResult>();

            lstAccChartAccount = new BLL <stp_acc_chart_account_treResult>().GetAllRecords_DB();
            long inv_destination_id;

            foreach (stp_inv_goods_receive_inv_goods_send_selResult record in ref_receive_send.ListBeforeChange)
            {
                invStore           = lstStore.Find(inv_store => inv_store.inv_store_id == record.inv_goods_receive_inv_goods_send_inv_store_id);
                inv_destination_id = record.inv_goods_receive_inv_goods_send_destination_acc_detail_id;

                accChartAccountInvStore.acc_chart_account_acc_detail_id = invStore != null ? invStore.inv_store_acc_detail_id : 0;
                accChartAccount = lstAccChartAccount.FindLast(acc_detail_id => acc_detail_id.acc_chart_account_acc_detail_id == accChartAccountInvStore.acc_chart_account_acc_detail_id);
                acc_document_article_inv_store = new stp_acc_document_article_selResult();
                acc_document_article_inv_store.acc_document_article_acc_chart_account_id   = accChartAccount != null ? accChartAccount.acc_chart_account_id : 0;
                acc_document_article_inv_store.acc_document_article_acc_chart_account_name = accChartAccount != null ? accChartAccount.acc_chart_account_name : "";
                acc_document_article_inv_store.acc_document_article_acc_chart_account_code = accChartAccount != null ? accChartAccount.acc_chart_account_code : "";
                acc_document_article_inv_store.acc_document_article_acc_chart_account_glb_entity_type_name = accChartAccount != null ? accChartAccount.acc_chart_account_glb_entity_type_name : "";
                acc_document_article_inv_store.acc_document_article_acc_detail_id = accChartAccount != null ? accChartAccount.acc_chart_account_acc_detail_id : null;
                acc_document_article_inv_store.acc_document_article_acc_chart_account_parent_names = accChartAccount.acc_chart_account_parent_names;
                //acc_document_article_inv_store.acc_document_article_acc_chart_account_group_name = accChartAccount.acc_chart_account_group_name;
                //acc_document_article_inv_store.acc_document_article_acc_chart_account_kol_name = accChartAccount.acc_chart_account_kol_name;
                //acc_document_article_inv_store.acc_document_article_acc_chart_account_moein_name = accChartAccount.acc_chart_account_moein_name;
                //acc_document_article_inv_store.acc_document_article_acc_chart_account_detail_name = accChartAccount.acc_chart_account_detail_name;
                acc_document_article_inv_store.acc_document_article_description = "جهت صدور سند مربوط به انبار";
                LstDocumentArticle.Add(acc_document_article_inv_store);

                accChartAccountInvDestination.acc_chart_account_acc_detail_id = inv_destination_id;
                accChartAccount = lstAccChartAccount.FindLast(acc_detail_id => acc_detail_id.acc_chart_account_acc_detail_id == accChartAccountInvDestination.acc_chart_account_acc_detail_id);
                acc_document_article_inv_destination = new stp_acc_document_article_selResult();
                acc_document_article_inv_destination.acc_document_article_acc_chart_account_id   = accChartAccount != null ? accChartAccount.acc_chart_account_id : 0;
                acc_document_article_inv_destination.acc_document_article_acc_chart_account_name = accChartAccount != null ? accChartAccount.acc_chart_account_name : "";
                acc_document_article_inv_destination.acc_document_article_acc_chart_account_code = accChartAccount != null ? accChartAccount.acc_chart_account_code : "";
                acc_document_article_inv_destination.acc_document_article_acc_chart_account_glb_entity_type_name = accChartAccount != null ? accChartAccount.acc_chart_account_glb_entity_type_name : "";
                acc_document_article_inv_destination.acc_document_article_description   = "جهت صدور سند مربوط به انبار";
                acc_document_article_inv_destination.acc_document_article_acc_detail_id = accChartAccount != null ? accChartAccount.acc_chart_account_acc_detail_id : null;
                acc_document_article_inv_destination.acc_document_article_acc_chart_account_parent_names = accChartAccount.acc_chart_account_parent_names;
                //acc_document_article_inv_destination.acc_document_article_acc_chart_account_group_name = accChartAccount.acc_chart_account_group_name;
                //acc_document_article_inv_destination.acc_document_article_acc_chart_account_kol_name = accChartAccount.acc_chart_account_kol_name;
                //acc_document_article_inv_destination.acc_document_article_acc_chart_account_moein_name = accChartAccount.acc_chart_account_moein_name;
                //acc_document_article_inv_destination.acc_document_article_acc_chart_account_detail_name = accChartAccount.acc_chart_account_detail_name;

                if (record.inv_goods_receive_inv_goods_send_is_receive == true)
                {
                    acc_document_article_inv_destination.acc_document_article_credit                = (double)(Convert.ToInt64(record.inv_goods_receive_inv_goods_send_sum_price));
                    acc_document_article_inv_store.acc_document_article_debt                        = (double)(Convert.ToInt64(record.inv_goods_receive_inv_goods_send_sum_price));
                    acc_document_article_inv_store.acc_document_article_inv_goods_receive_id        = record.inv_goods_receive_inv_goods_send_id;
                    acc_document_article_inv_destination.acc_document_article_inv_goods_receive_id  = record.inv_goods_receive_inv_goods_send_id;
                    acc_document_article_inv_store.acc_document_article_inventory_information       = "رسید شماره   " + record.inv_goods_receive_inv_goods_send_no + "  از  " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name;
                    acc_document_article_inv_destination.acc_document_article_inventory_information = "رسید شماره   " + record.inv_goods_receive_inv_goods_send_no + "  از  " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name;
                }
                else
                {
                    acc_document_article_inv_destination.acc_document_article_debt                  = (double)((long)record.inv_goods_receive_inv_goods_send_sum_price);
                    acc_document_article_inv_store.acc_document_article_credit                      = (double)((long)record.inv_goods_receive_inv_goods_send_sum_price);
                    acc_document_article_inv_store.acc_document_article_inv_goods_send_id           = record.inv_goods_receive_inv_goods_send_id;
                    acc_document_article_inv_destination.acc_document_article_inv_goods_send_id     = record.inv_goods_receive_inv_goods_send_id;
                    acc_document_article_inv_store.acc_document_article_inventory_information       = "حواله شماره   " + record.inv_goods_receive_inv_goods_send_no + "  از  " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name;
                    acc_document_article_inv_destination.acc_document_article_inventory_information = "حواله شماره   " + record.inv_goods_receive_inv_goods_send_no + "  از  " + acc_document_article_inv_store.acc_document_article_acc_chart_account_name;
                }

                LstDocumentArticle.Add(acc_document_article_inv_destination);
            }

            if (LstDocumentArticle.Count != 0)
            {
                Form_Acc_Document = new frm_acc_document();
                if (Form_Acc_Document.CreateDocument(DocumentRecord, LstDocumentArticle))
                {
                    ref_receive_send.ListAfterChange.Clear();
                }
            }
        }
    protected void btn_Add_Click(object sender, EventArgs e)
    {
        try
        {
            bool status1 = chkAcctNo();
            if (status1 == false)
            {
                if (rtxt_AccountNo.Text.Length != 12)
                {
                    BLL.ShowMessage(this, "Account Number Should be 12 Chars Length");
                    return;
                }
                _obj_smhr_empbnkdetails                      = new SMHR_EMPBNKDTLS();
                _obj_smhr_empbnkdetails.OPERATION            = operation.Insert;
                _obj_smhr_empbnkdetails.EMPBNKDTLS_EMPID     = Convert.ToInt32(rcmb_Employee.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNITBANK_BANKID   = Convert.ToInt32(rcmb_Bank.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNITBANK_BRANCHID = Convert.ToInt32(rcmb_Branch.SelectedItem.Value);
                _obj_smhr_empbnkdetails.BUSUNTBANK_ADDRESS   = Convert.ToString(rtxt_Address.Text.Replace("'", "''"));
                _obj_smhr_empbnkdetails.BUSUNTBANK_ACCOUNTNO = Convert.ToString(rtxt_AccountNo.Text);
                _obj_smhr_empbnkdetails.BUSUNTBANK_SWIFT     = Convert.ToString(rtxt_SwiftCode.Text.Replace("'", "''"));
                if (rcmb_Active.SelectedValue == "1")
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = true;
                }
                else
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISACTIVE = false;
                }

                if (chk_Default.Checked)
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = true;
                }
                else
                {
                    _obj_smhr_empbnkdetails.BUSUNTBANK_ISDEFAULT = false;
                }
                _obj_smhr_empbnkdetails.BUSUNTBANK_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_empbnkdetails.BUSUNTBANK_CREATEDDATE = DateTime.Now;
                _obj_smhr_empbnkdetails.ORGANISATION_ID        = Convert.ToInt32(Session["ORG_ID"]);
                bool status = BLL.set_Identification(_obj_smhr_empbnkdetails);
                if (status == true)
                {
                    BLL.ShowMessage(this, "Employee Bank Details Saved Successfully");
                    LoadData();
                    RG_Identification.DataBind();
                    MarkData();
                    RMP_Identification.SelectedIndex = 0;
                    return;
                }
                else
                {
                    BLL.ShowMessage(this, "Error Occured while doing the Process");
                    return;
                }
            }
            else
            {
                BLL.ShowMessage(this, "Account Number is already Defined");
                rtxt_AccountNo.Focus();
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempidentification", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                RMP_Identification.SelectedIndex = 0;
                LoadData();
                RG_Identification.DataBind();
                MarkData();
                tr1.Visible = false;
            }
            default1.Visible = false;

            Session.Remove("WRITEFACILITY");

            SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

            _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
            _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
            _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("IDENTIFICATION");
            DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
            if (dtformdtls.Rows.Count != 0)
            {
                if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                {
                    Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                }
            }
            else
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }


            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                RG_Identification.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_Add.Visible     = false;
                btn_Correct.Visible = false;
            }
            else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frmempidentification", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #34
0
        private void bt_Luu_Click(object sender, EventArgs e)
        {
            try
            {
                Entity_DiemCong dc = new Entity_DiemCong();
                BLL             b  = new BLL();
                dc.Madiem  = maDiemCongTextEdit.Text.Trim();
                dc.Tendiem = tenDiemCongTextEdit.Text.Trim();
                dc.Diem    = (float)Convert.ToDouble(tb_diemcong.Text.Trim());
                dc.Diem   /= 10;

                //-------------------------------------------

                if (key == 1)
                {
                    if (b.CheckID("select * from DiemCong where MaDiemCong='" + dc.Madiem + "'") > 0)
                    {
                        MessageBox.Show("Đã tồn tại Mã điểm cộng này", "Lỗi");
                    }
                    else if (dc.Madiem == null)
                    {
                        MessageBox.Show("Mã điểm cộng không được để trống", "Lỗi");
                    }
                    else
                    {
                        b.QueryIDU("insert into DiemCong values('" + dc.Madiem + "',N'" + dc.Tendiem + "','" + tb_diemcong.Text + "')");
                    }
                }
                else if (key == 2)
                {
                    if (b.CheckID("select * from DiemCong where MaDiemCong='" + dc.Madiem + "'") == 0)
                    {
                        MessageBox.Show("Không tồn tại Mã điểm cộng này", "Lỗi");
                    }
                    else
                    {
                        b.QueryIDU("update DiemCong set TenDiemCong=N'" + dc.Tendiem + "',DiemCong='" + tb_diemcong.Text + "' where MaDiemCong='" + dc.Madiem + "'");
                    }
                }
                else if (key == 3)
                {
                    if (b.CheckID("select * from DiemCong where MaDiemCong='" + dc.Madiem + "'") == 0)
                    {
                        MessageBox.Show("Không tồn tại Mã điểm cộng này", "Lỗi");
                    }
                    else if (b.CheckID("select MaDiemCong from Diem where MaDiemCong='" + dc.Madiem + "'") > 0)
                    {
                        MessageBox.Show("Không xóa được Mã điểm cộng này \nĐể thực hiện cần xóa hết dữ liệu tham chiếu!\nDữ liệu tham chiếu được tìm thấy trong Cơ sở dữ liệu Theo dõi rèn luyện", "Lỗi");
                    }
                    else
                    {
                        b.QueryIDU("delete from DiemCong where MaDiemCong='" + dc.Madiem + "'");
                    }
                }
                //-----------------------------------------------
                key            = 0;
                bt_Luu.Enabled = false;
                Load_Data();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString(), "Lỗi");
            }
        }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            SMHR_SHIFTDEFINITION _obj_Smhr_ShiftDefinition = new SMHR_SHIFTDEFINITION();

            _obj_Smhr_ShiftDefinition.SHIFT_CODE      = Convert.ToString(rtxt_ShiftCode.Text);
            _obj_Smhr_ShiftDefinition.SHIFT_DESC      = Convert.ToString(rtxt_ShiftDesc.Text);
            _obj_Smhr_ShiftDefinition.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"].ToString());
            _obj_Smhr_ShiftDefinition.SHIFT_STARTTIME = Convert.ToString(Convert.ToDateTime(rtp_ShiftStartTime.SelectedDate).TimeOfDay);
            _obj_Smhr_ShiftDefinition.SHIFT_ENDTIME   = Convert.ToString(Convert.ToDateTime(rtp_ShiftEndTime.SelectedDate).TimeOfDay);

            _obj_Smhr_ShiftDefinition.SHIFT_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_ShiftDefinition.SHIFT_CREATEDDATE = DateTime.Now;

            _obj_Smhr_ShiftDefinition.SHIFT_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_ShiftDefinition.SHIFT_LASTMDFDATE = DateTime.Now;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_EDIT":
                _obj_Smhr_ShiftDefinition.SHIFT_ID = Convert.ToInt32(lbl_ShiftID.Text);
                //_obj_Smhr_ShiftDefinition.OPERATION = operation.Check;
                //if (Convert.ToString(BLL.get_ShiftDefinition(_obj_Smhr_ShiftDefinition).Rows[0]["Count"]) != "1")
                //{
                //    BLL.ShowMessage(this, "Shift is already defined with this code");
                //    return;
                //}
                _obj_Smhr_ShiftDefinition.OPERATION = operation.Update;
                if (BLL.set_ShiftDefinition(_obj_Smhr_ShiftDefinition))
                {
                    BLL.ShowMessage(this, "Information updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }

                break;

            case "BTN_SAVE":
                _obj_Smhr_ShiftDefinition.OPERATION = operation.Check;
                if (Convert.ToString(BLL.get_ShiftDefinition(_obj_Smhr_ShiftDefinition).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Shift Definition With this Name Already Exists");
                    return;
                }
                _obj_Smhr_ShiftDefinition.OPERATION = operation.Insert;
                if (BLL.set_ShiftDefinition(_obj_Smhr_ShiftDefinition))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_Shift_page.SelectedIndex = 0;
            LoadGrid();
            Rg_Shift.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_shiftDefinition", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            _obj_Smhr_Period = new SMHR_PERIOD();
            _obj_Smhr_Prddtl = new SMHR_PERIODDTL();
            StringBuilder strQry = new StringBuilder();

            //Entities of PERIOD TABLE
            _obj_Smhr_Period = new SMHR_PERIOD();
            // _obj_Smhr_Period.ORGANISATION_ID = 2;
            _obj_Smhr_Period.ORGANISATION_ID     = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_Period.PERIOD_NAME         = Convert.ToString(rtxt_PeriodName.Text);
            _obj_Smhr_Period.PERIOD_TYPE         = Convert.ToInt32(rcmb_PeriodType.SelectedItem.Value);
            _obj_Smhr_Period.PERIOD_STARTDATE    = (Convert.ToDateTime(Convert.ToDateTime(rdtp_StartDate.SelectedDate).ToShortDateString()));
            _obj_Smhr_Period.PERIOD_ENDDATE      = Convert.ToDateTime(rdtp_EndDate.SelectedDate);
            _obj_Smhr_Period.PERIOD_DURATION     = Convert.ToInt32(rtxt_Duration.Text);
            _obj_Smhr_Period.PERIOD_DURATIONTYPE = Convert.ToInt32(rcmb_DurationType.SelectedIndex);
            _obj_Smhr_Period.PERIOD_CREATEDBY    = Convert.ToInt32(Session["USER_ID"]);
            _obj_Smhr_Period.PERIOD_CREATEDDATE  = DateTime.Now;
            _obj_Smhr_Period.PERIOD_LASTMDFBY    = Convert.ToInt32(Session["USER_ID"]);
            _obj_Smhr_Period.PERIOD_LASTMDFDATE  = DateTime.Now;

            if (((Button)sender).ID.ToUpper() == "BTN_EDIT")
            {
                for (int i = 0; i < Rg_PeriodDetails.Items.Count; i++)
                {
                    _obj_Smhr_Prddtl.PRDDTL_ID   = Convert.ToInt32(Rg_PeriodDetails.Items[i].Cells[2].Text);
                    _obj_Smhr_Prddtl.PRDDTL_NAME = Convert.ToString(Rg_PeriodDetails.Items[i].Cells[3].Text);
                    //_obj_Smhr_Prddtl.PRDDTL_STARTDATE = Convert.ToDateTime(Rg_PeriodDetails.Items[i].Cells[4].Text);
                    //string date =Rg_PeriodDetails.Items[i].Cells[5].Text;
                    //DateTime dt = DateTime.ParseExact(date, "MM/dd/yyyy", CultureInfo.InvariantCulture);
                    //_obj_Smhr_Prddtl.ENDDATE = Convert.ToDateTime(dt);
                    RadComboBox rdcmbstatus;
                    rdcmbstatus = (RadComboBox)Rg_PeriodDetails.Items[i].FindControl("rcmb_Status");
                    _obj_Smhr_Prddtl.PRDDTL_STATUS      = Convert.ToInt32(rdcmbstatus.SelectedItem.Value);
                    _obj_Smhr_Prddtl.PRDDTL_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                    _obj_Smhr_Prddtl.PRDDTL_LASTMDFDATE = DateTime.Now;

                    _obj_Smhr_Prddtl.OPERATION = operation.Update;

                    strQry.Append(BLL.set_PeriodDetails(_obj_Smhr_Prddtl) + " \n");
                }

                if (BLL.ExecuteNonQuery(strQry.ToString()))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
            }
            else
            {
                _obj_Smhr_Period.OPERATION       = operation.Check;
                _obj_Smhr_Period.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                if (Convert.ToString(BLL.get_PeriodHeaderDetails(_obj_Smhr_Period).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Period with this Name Already Exists");
                    return;
                }
                //// to validate the PERIOD START DATE
                //_obj_Smhr_Period.OPERATION = operation.Validate;
                //if (Convert.ToInt32(BLL.get_PeriodHeaderDetails(_obj_Smhr_Period).Rows[0]["Count"]) > 0)
                //{
                //    BLL.ShowMessage(this, "Period had already been defined using this date, please select another date");
                //    return;
                //}

                // to validate the PERIOD START DATE
                _obj_Smhr_Period.OPERATION        = operation.Validate1;
                _obj_Smhr_Period.PERIOD_STARTDATE = Convert.ToDateTime(rdtp_StartDate.SelectedDate);
                _obj_Smhr_Period.PERIOD_ENDDATE   = Convert.ToDateTime(rdtp_EndDate.SelectedDate);
                _obj_Smhr_Period.ORGANISATION_ID  = Convert.ToInt32(Session["ORG_ID"]);
                if (Convert.ToInt32(BLL.get_PeriodHeaderDetails(_obj_Smhr_Period).Rows[0]["Count"]) > 0)
                {
                    BLL.ShowMessage(this, "Period had already been defined using this date, please select another date");
                    return;
                }
                _obj_Smhr_Period.OPERATION = operation.Insert;

                if (BLL.set_PeriodHeaderdetails(_obj_Smhr_Period))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
            }

            Rm_Period_page.SelectedIndex = 0;

            LoadMainGrid();
            Rg_Period.DataBind();

            ViewState["Rg_PeriodDetails"] = null;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Period", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btn_Reject_Click(object sender, EventArgs e)
    {
        try
        {
            CheckBox chkBox = new CheckBox();
            Label    lblID  = new Label();
            int      index;
            int      i   = 0;
            string   str = "";
            for (index = 0; index <= RG_ExpenseApproval.Items.Count - 1; index++)
            {
                chkBox = RG_ExpenseApproval.Items[index].FindControl("chk_Choose") as CheckBox;
                lblID  = RG_ExpenseApproval.Items[index].FindControl("lblexpID") as Label;
                if (chkBox.Checked)
                {
                    I_ChkCount = I_ChkCount + 1;
                    if (str == "")
                    {
                        str = "" + lblID.Text + "";
                    }
                    else
                    {
                        str = str + "," + lblID.Text + "";
                    }

                    bool status = false;
                    _obj_smhr_expense = new SMHR_EXPENSE();
                    _obj_smhr_expense.EXPENSE_STATUS       = 2;
                    _obj_smhr_expense.EXPENSE_NAME         = str;
                    _obj_smhr_expense.EXPENSE_APPROVEDBY   = Convert.ToInt32(rtxt_ReportingMgr.Text);
                    _obj_smhr_expense.EXPENSE_APPROVEDDATE = Convert.ToDateTime(rdp_ApprovalDate.SelectedDate.Value);
                    _obj_smhr_expense.LASTMDFBY            = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_expense.LASTMDFDATE          = DateTime.Now;
                    _obj_smhr_expense.OPERATION            = operation.Update;
                    status = BLL.set_Expense(_obj_smhr_expense);
                    if (status == true)
                    {
                        BLL.ShowMessage(this, "Selected Expenses Rejected");
                        LoadData();
                        RG_ExpenseApproval.DataBind();
                        return;
                    }
                }
                else
                {
                    i = i + 1;
                }
            }
            if (I_ChkCount == 0)
            {
                BLL.ShowMessage(this, "Please Select Employees");
                return;
            }

            //if (i == RG_ExpenseApproval.Items.Count)
            //{
            //    BLL.ShowMessage(this, "Please Select Employees");
            //    return;
            //}
            //bool status = false;
            //_obj_smhr_expense = new SMHR_EXPENSE();
            //_obj_smhr_expense.EXPENSE_STATUS = 2;
            //_obj_smhr_expense.EXPENSE_NAME = str;
            //_obj_smhr_expense.EXPENSE_APPROVEDBY = Convert.ToInt32(rtxt_ReportingMgr.Text);
            //_obj_smhr_expense.EXPENSE_APPROVEDDATE = Convert.ToDateTime(rdp_ApprovalDate.SelectedDate.Value);
            //_obj_smhr_expense.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]);
            //_obj_smhr_expense.LASTMDFDATE = DateTime.Now;
            //_obj_smhr_expense.OPERATION = operation.Update;
            //status = BLL.set_Expense(_obj_smhr_expense);
            //if (status == true)
            //{
            //    BLL.ShowMessage(this, "Selected Expenses Rejected");
            //    LoadData();
            //    RG_ExpenseApproval.DataBind();
            //    //RG_ExpenseApproval.Visible = false;
            //    return;
            //}
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ExpenseApproval", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();
                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("EXPENSE APPROVAL");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    RG_ExpenseApproval.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Approve.Visible = false;
                    btn_Reject.Visible  = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                rtxt_ReportingMgr.Text        = Convert.ToString(Session["EMP_ID"]);
                RG_ExpenseApproval.Visible    = true;
                rdp_ApprovalDate.SelectedDate = DateTime.Now;
                BLL.ChangeDateFormat(Convert.ToString(Session["EMP_ID"]), rdp_ApprovalDate);
            }
            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ }", true);
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ExpenseApproval", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #39
0
 private void GridViewbind()
 {
     this.GridView1.DataSource = BLL.PL3_KD_SeleteByNum(30);
     this.GridView1.DataBind();
 }
    protected void rcmb_PeriodStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        try
        {
            Rg_PayReults.Visible = false;
            rcb_Transaction.Items.Clear();
            rcb_Transaction.Text = string.Empty;
            rcb_Transaction.Items.Insert(0, new RadComboBoxItem("", ""));
            lnk.Visible          = false;
            lnk_Approved.Visible = false;
            //added for link to Payroll Reports. By Anirudh
            //if (rcmb_PeriodStatus.SelectedIndex > 0)
            //{
            //    if ((rcmb_PeriodStatus.SelectedItem.Text).ToUpper() == "PENDING")
            //    {
            //        if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0))
            //        {
            //            lnk.Visible = true;
            //            lnk_Approved.Visible = false;
            //        }
            //        else
            //        {
            //            lnk.Visible = false;
            //            lnk_Approved.Visible = false;
            //        }
            //    }
            //    else if ((rcmb_PeriodStatus.SelectedItem.Text).ToUpper() == "APPROVED")
            //    {
            //        if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0))
            //        {
            //            lnk.Visible = false;
            //            lnk_Approved.Visible = true;
            //        }
            //        else
            //        {
            //            lnk.Visible = false;
            //            lnk_Approved.Visible = false;
            //        }
            //    }
            //    else
            //    {
            //        lnk.Visible = false;
            //        lnk_Approved.Visible = false;
            //    }
            //}

            //if(rcmb_PeriodStatus.SelectedIndex==0)
            //{
            //    lnk.Visible=false;
            //    lnk_Approved.Visible=false;
            //}
            /////////////////////////

            if (rcmb_PeriodStatus.SelectedIndex != 0)
            {
                if ((rcmb_BUI.SelectedIndex > 0) && (rcmb_PeriodMaster.SelectedIndex > 0) && (rcmb_PeriodElement.SelectedIndex > 0))
                {
                    if (rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(1)) //Approved
                    {
                        rcb_Transaction.Items.Clear();
                        _obj_smhr_payroll             = new SMHR_PAYROLL();
                        _obj_smhr_payroll.MODE        = 30;
                        _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                        _obj_smhr_payroll.BUID        = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                        DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll);
                        if (dt.Rows.Count != 0)
                        {
                            rcb_Transaction.Items.Clear();
                            rcb_Transaction.DataSource     = dt;
                            rcb_Transaction.DataTextField  = "PAYTRAN_NAME";
                            rcb_Transaction.DataValueField = "PAYTRAN_ID";
                            rcb_Transaction.DataBind();
                            rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
                        }
                    }
                    else if ((rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(2))) //Rejected
                    {
                        rcb_Transaction.Items.Clear();

                        _obj_smhr_payroll             = new SMHR_PAYROLL();
                        _obj_smhr_payroll.MODE        = 31;
                        _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                        _obj_smhr_payroll.BUID        = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                        DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll);
                        if (dt.Rows.Count != 0)
                        {
                            rcb_Transaction.Items.Clear();
                            rcb_Transaction.DataSource     = dt;
                            rcb_Transaction.DataTextField  = "PAYTRAN_NAME";
                            rcb_Transaction.DataValueField = "PAYTRAN_ID";
                            rcb_Transaction.DataBind();
                            rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
                        }
                    }
                    else //Pending
                    {
                        rcb_Transaction.Items.Clear();
                        _obj_smhr_payroll             = new SMHR_PAYROLL();
                        _obj_smhr_payroll.MODE        = 22;
                        _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                        _obj_smhr_payroll.BUID        = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                        DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll);
                        if (dt.Rows.Count != 0)
                        {
                            //_obj_smhr_payroll = new SMHR_PAYROLL();
                            //_obj_smhr_payroll.MODE = 22;
                            //_obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                            //_obj_smhr_payroll.BUID = Convert.ToInt32(rcmb_businessunit.SelectedItem.Value);
                            //DataTable dt = BLL.get_PayDetails(_obj_smhr_payroll);
                            rcb_Transaction.Items.Clear();
                            rcb_Transaction.DataSource     = dt;
                            rcb_Transaction.DataTextField  = "TEMP_PAYTRAN_NAME";
                            rcb_Transaction.DataValueField = "TEMP_PAYTRAN_ID";
                            rcb_Transaction.DataBind();
                            rcb_Transaction.Items.Insert(0, new Telerik.Web.UI.RadComboBoxItem("Select"));
                            //RG_Transaction.Visible = false;
                            //btn_Rollback.Visible = false;
                        }
                        else
                        {
                            //RG_Transaction.Visible = false;
                            //btn_Rollback.Visible = false;
                        }
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "Select All Paramaters.");
                    return;
                }
            }
            else
            {
                rcb_Transaction.Items.Clear();
                rcb_Transaction.Items.Insert(0, new RadComboBoxItem("", ""));
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payresults", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btn_submit_Click(object sender, EventArgs e)
    {
        try
        {
            if (rcmb_FromPeriod.SelectedIndex <= 0)
            {
                BLL.ShowMessage(this, "Please Select Financial Period");
                return;
            }

            RadNumericTextBox rntbDependent;
            RadNumericTextBox rntbEligible;
            int count = 0;

            for (int i = 0; i < RG_Allowance.Items.Count; i++)
            {
                rntbDependent = RG_Allowance.Items[i].FindControl("rntbDependent") as RadNumericTextBox;
                rntbEligible  = RG_Allowance.Items[i].FindControl("rntbEligible") as RadNumericTextBox;

                if (rntbDependent.Text != string.Empty || rntbEligible.Text != string.Empty)
                {
                    if ((rntbDependent.Text == string.Empty && rntbEligible.Text != string.Empty) || (rntbDependent.Text != string.Empty && rntbEligible.Text == string.Empty))
                    {
                        if (rntbDependent.Text == string.Empty && rntbEligible.Text != string.Empty)
                        {
                            BLL.ShowMessage(this, "Please Enter Dependent value for S.NO: " + (i + 1).ToString());
                            rntbDependent.Focus();
                            return;
                        }
                        else
                        {
                            BLL.ShowMessage(this, "Please Enter Eligible value for S.NO: " + (i + 1).ToString());
                            rntbEligible.Focus();
                            return;
                        }
                    }
                }
                if (rntbDependent.Text == string.Empty || rntbEligible.Text == string.Empty)
                {
                    count++;
                }
            }

            if (count == RG_Allowance.Items.Count)
            {
                BLL.ShowMessage(this, "No records have any entered values..");
                return;
            }

            string    errorMsg    = string.Empty;
            DataTable dtallowance = GetAllowance(out errorMsg);
            if (!string.IsNullOrEmpty(errorMsg))
            {
                BLL.ShowMessage(this, errorMsg);
                return;
            }

            SMHR_ALLOWANCE all = new SMHR_ALLOWANCE();
            all.ALLOWANCE_GRIDDATA  = dtallowance;
            all.ALLOWANCE_ORG_ID    = Convert.ToInt32(Session["ORG_ID"]);
            all.ALLOWANCE_PERIOD_ID = Convert.ToInt32(rcmb_FromPeriod.SelectedValue);
            all.MODE = payItemID;
            all.ALLOWANCE_CONFG_ID    = valID;
            all.ALLOWANCE_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
            all.ALLOWANCE_CREATEDDATE = DateTime.Now;
            all.ALLOWANCE_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
            all.ALLOWANCE_LASTMDFDATE = DateTime.Now;

            switch (((Button)sender).Text.ToUpper())
            {
            case "SAVE":
                all.OPERATION = operation.Insert;
                if (BLL.Set_Allowance(all))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Allowance", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            return;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            valID     = Convert.ToInt32(Request.QueryString["val"]);
            payItemID = Convert.ToInt32(Request.QueryString["payItemID"]);

            Session.Remove("WRITEFACILITY");

            SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

            _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
            _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
            _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Pay Item");

            DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
            if (dtformdtls.Rows.Count != 0)
            {
                if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                {
                    Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                }
                else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                {
                    Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                }
            }
            else
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }
            if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
            {
                //RG_TrainingApproval.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                btn_submit.Visible = false;
                // btn_Update.Visible = false;
            }
            else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
            {
                smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                Response.Redirect("~/frm_UnAuthorized.aspx", false);
            }
            LoadPeriod();
            if (Convert.ToInt32(Request.QueryString["val"]) == 0)
            {
                lbl_Allowance.Text = "Dependent Allowance";
            }
            else if (Convert.ToInt32(Request.QueryString["val"]) == 1)
            {
                lbl_Allowance.Text = "Education Allowance";
            }
            else
            {
                lbl_Allowance.Text = "Medical Allowance";
            }
        }
    }
    private void LoadSaldtlsold()
    {
        try
        {
            DataTable dt = new DataTable();
            if (rcmb_PeriodStatus.SelectedIndex != 0)
            {
                _obj_smhr_payroll             = new SMHR_PAYROLL();
                _obj_smhr_payroll.BUID        = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                if (rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(1)) //Approved
                {
                    _obj_smhr_payroll.MODE = 10;

                    dt = BLL.get_PayDetails(_obj_smhr_payroll);
                    if (dt.Rows.Count != 0)
                    {
                        Rg_PayReults.DataSource = dt;
                        Rg_PayReults.DataBind();
                    }
                    else
                    {
                        _obj_smhr_payroll             = new SMHR_PAYROLL();
                        _obj_smhr_payroll.BUID        = Convert.ToInt32(rcmb_BUI.SelectedItem.Value);
                        _obj_smhr_payroll.PERIODDTLID = Convert.ToInt32(rcmb_PeriodElement.SelectedItem.Value);
                        _obj_smhr_payroll.MODE        = 25;
                        DataTable dt_1 = BLL.get_PayDetails(_obj_smhr_payroll);
                        if (dt_1.Rows.Count != 0)
                        {
                            Rg_PayReults.DataSource = dt_1;
                            Rg_PayReults.DataBind();
                        }
                        else
                        {
                            dt.Rows.Clear();
                            Rg_PayReults.DataSource = dt;
                            Rg_PayReults.DataBind();
                        }
                    }
                }
                else if ((rcmb_PeriodStatus.SelectedItem.Value == Convert.ToString(2))) //Rejected
                {
                    _obj_smhr_payroll.MODE = 12;
                    dt = BLL.get_PayDetails(_obj_smhr_payroll);
                    if (dt.Rows.Count != 0)
                    {
                        Rg_PayReults.DataSource = dt;
                        Rg_PayReults.DataBind();
                    }
                    else
                    {
                        dt.Rows.Clear();
                        Rg_PayReults.DataSource = dt;
                        Rg_PayReults.DataBind();
                    }
                }
                else //Pending
                {
                    _obj_smhr_payroll.MODE = 13;
                    dt = BLL.get_PayDetails(_obj_smhr_payroll);
                    if (dt.Rows.Count != 0)
                    {
                        Rg_PayReults.DataSource = dt;
                        Rg_PayReults.DataBind();
                    }
                    else
                    {
                        dt.Rows.Clear();
                        Rg_PayReults.DataSource = dt;
                        Rg_PayReults.DataBind();
                    }
                }
                Rg_PayReults.Visible = true;
            }
            else
            {
                dt.Rows.Clear();
                Rg_PayReults.DataSource = dt;
                Rg_PayReults.DataBind();
            }

            foreach (GridDataItem dataItem in Rg_PayReults.MasterTableView.Items)
            {
                if (dataItem["SALARY"].Text.StartsWith("-"))
                {
                    dataItem.BackColor = System.Drawing.Color.Red;
                    dataItem.ForeColor = System.Drawing.Color.White;
                    dataItem.ToolTip   = "Note: Negative salary for this Employee";
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payresults", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void lnk_Edit_Command(object sender, CommandEventArgs e)
    {
        try
        {
            ViewState["Rg_PeriodDetails"] = null;
            _obj_Smhr_Period = new SMHR_PERIOD();
            _obj_Smhr_Prddtl = new SMHR_PERIODDTL();

            _obj_Smhr_Period.PERIOD_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument));
            dt = BLL.get_PeriodHeaderDetails(_obj_Smhr_Period);
            if (dt.Rows.Count > 0)
            {
                rtxt_PeriodName.Text          = Convert.ToString(dt.Rows[0]["PERIOD_NAME"]);
                rcmb_PeriodType.SelectedIndex = rcmb_PeriodType.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PERIOD_TYPE"]));
                rdtp_StartDate.SelectedDate   = Convert.ToDateTime(dt.Rows[0]["PERIOD_STARTDATE"]);
                rdtp_EndDate.SelectedDate     = Convert.ToDateTime(dt.Rows[0]["PERIOD_ENDDATE"]);
                rtxt_Duration.Text            = Convert.ToString(dt.Rows[0]["PERIOD_DURATION"]);
                rcmb_PeriodType_SelectedIndexChanged(null, null);
                rcmb_DurationType.SelectedIndex = rcmb_DurationType.Items.FindItemIndexByValue(Convert.ToString(dt.Rows[0]["PERIOD_DURATIONTYPE"]));

                rtxt_PeriodName.Enabled   = false;
                rcmb_PeriodType.Enabled   = false;
                rdtp_StartDate.Enabled    = false;
                rdtp_EndDate.Enabled      = false;
                rtxt_Duration.Enabled     = false;
                rcmb_DurationType.Enabled = false;

                Rm_Period_page.SelectedIndex = 1;
                btn_GeneratePeriods.Visible  = false;
                btn_Save.Visible             = false;


                //code for security
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    btn_Edit.Visible = false;
                }

                else
                {
                    btn_Edit.Visible = true;
                }
                _obj_Smhr_Prddtl.OPERATION        = operation.Select;
                _obj_Smhr_Prddtl.PRDDTL_PERIOD_ID = Convert.ToInt32(Convert.ToString(e.CommandArgument));

                DataTable dttemp = BLL.get_PeriodDetails(_obj_Smhr_Prddtl);

                ViewState["Rg_PeriodDetails"] = dttemp;
                Rg_PeriodDetails.DataSource   = dttemp;
                Rg_PeriodDetails.DataBind();
                Rg_Period.Visible = true;
            }
            else
            {
                BLL.ShowMessage(this, "The End Date for the Period Define has been completed");
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Period", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("FINANCIAL PERIOD");

                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);

                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }

                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    Rg_Period.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Save.Visible = false;
                    btn_Edit.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }

                duration.Visible    = false;
                rtxt_Duration.Value = 1;

                LoadCombos();
                BLL.ChangeDateFormat(Convert.ToString(Session["EMP_ID"]), rdtp_StartDate, rdtp_EndDate);

                if (Request.QueryString["POP"] != null)
                {
                    ((HtmlTableRow)Master.FindControl("M_Header")).Style.Add("display", "none");
                    ((HtmlTableRow)Master.FindControl("M_Footer")).Style.Add("display", "none");
                    ((RadMenu)Master.FindControl("MainMenu")).Style.Add("display", "none");
                    ((RadComboBox)Master.FindControl("cmbCulture")).Style.Add("display", "none");
                    ((LinkButton)Master.FindControl("Lnk_LogOut")).Style.Add("display", "none");
                    ((LinkButton)Master.FindControl("lnk_Home")).Style.Add("display", "none");
                }

                BLL.gridDateFormat(Convert.ToString(Session["EMP_ID"]), Rg_Period, "PERIOD_STARTDATE", "PERIOD_ENDDATE");
                BLL.gridDateFormat(Convert.ToString(Session["EMP_ID"]), Rg_PeriodDetails, "PRDDTL_STARTDATE", "PRDDTL_ENDDATE");
            }
            Rg_PeriodDetails.CurrentPageIndex = 0;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Period", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
 protected override void InitializeCulture()
 {
     BLL.SetCulture_Theme(Page, Request);
     base.InitializeCulture();
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Shift Definition");//SHIFTDEFINITATION");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    Rg_Shift.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    btn_Save.Visible = false;
                    btn_Edit.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }

                LoadGrid();
                Rg_Shift.DataBind();
                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    for (int i = 0; i < Rg_Shift.Items.Count; i++)
                    {
                        LinkButton lnkdel = new LinkButton();
                        lnkdel         = (LinkButton)Rg_Shift.Items[i].FindControl("lnk_Delete") as LinkButton;
                        lnkdel.Visible = false;
                    }
                }

                Page.Validate();
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_shiftDefinition", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #48
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            DateTime startDate    = radStartdate.SelectedDate.Value.Date;
            DateTime endDate      = radEndDate.SelectedDate.Value.Date;
            double   NumberOfDays = endDate.AddDays(1).Subtract(startDate).TotalDays;
            if (Convert.ToInt32(radSessions.Text) > Convert.ToInt32(NumberOfDays))
            {
                BLL.ShowMessage(this, "Please Check Number Of Days should be between Start Date and End Date");
                return;
            }


            SMHR_COURSESCHEDULE _obj_Smhr_CourseSchedule = new SMHR_COURSESCHEDULE();
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_COURSEID     = Convert.ToInt32(radCourse.SelectedValue);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_COURSETYPEID = Convert.ToInt32(radCourseType.SelectedValue);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_LOCATIONID   = Convert.ToInt32(radLocation.SelectedValue);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_ROOMID       = Convert.ToInt32(radTrainingRoom.SelectedValue);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_TRAINERID    = Convert.ToInt32(radTrainers.SelectedValue);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_NOOFSESSIONS = Convert.ToInt32(radSessions.Text);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_NOOFSEATS    = Convert.ToInt32(radSeats.Text);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_STARTDATE    = Convert.ToDateTime(radStartdate.SelectedDate);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_SATARTTIME   = Convert.ToDateTime(radStartTime.SelectedDate);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_ENDDATE      = Convert.ToDateTime(radEndDate.SelectedDate);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_ENDTIME      = Convert.ToDateTime(radEndTime.SelectedDate);
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_NAME         = radBatchDetail.Text;
            _obj_Smhr_CourseSchedule.COURSESCHEDULE_STATUS       = rad_IsActive.Checked;

            _obj_Smhr_CourseSchedule.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_CourseSchedule.CREATEDDATE     = DateTime.Now;
            _obj_Smhr_CourseSchedule.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_Smhr_CourseSchedule.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]); // ### Need to Get the Session
            _obj_Smhr_CourseSchedule.LASTMDFDATE     = DateTime.Now;

            SMHR_TRAINING_ROOM _obj_Smhr_Room; DataTable dtRooms;
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_SAVE":

                _obj_Smhr_Room = new SMHR_TRAINING_ROOM();
                _obj_Smhr_Room.ORGANISATION_ID     = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_Room.ROOMID              = Convert.ToInt32(radTrainingRoom.SelectedValue);
                _obj_Smhr_Room.SMHR_COURSESCHEDULE = new SMHR_COURSESCHEDULE();
                _obj_Smhr_Room.SMHR_COURSESCHEDULE.COURSESCHEDULE_STARTDATE  = (DateTime)radStartdate.SelectedDate;
                _obj_Smhr_Room.SMHR_COURSESCHEDULE.COURSESCHEDULE_SATARTTIME = (DateTime)radStartTime.SelectedDate;
                _obj_Smhr_Room.OPERATION = operation.Select1;
                dtRooms = BLL.get_TrainingRooms(_obj_Smhr_Room);
                if (Convert.ToBoolean(dtRooms.Rows[0]["Status"]))
                {
                    int roomStrength = Convert.ToInt32(dtRooms.Rows[0]["ROOMS_STRENGTH"]);
                    if (Convert.ToInt32(radSeats.Text) > roomStrength)
                    {
                        BLL.ShowMessage(this, "Number of Seats should be less than or equal to " + Convert.ToString(roomStrength));
                        return;
                    }
                }
                else
                {
                    BLL.ShowMessage(this, "This Room is Already Allocated");
                    return;
                }

                _obj_Smhr_CourseSchedule.COURSESCHEDULE_COURSEID = Convert.ToInt32(radCourse.SelectedValue);
                _obj_Smhr_CourseSchedule.OPERATION = operation.Check;

                if (Convert.ToString(BLL.get_CourseSchedule(_obj_Smhr_CourseSchedule).Rows[0]["Count"]) != "0")
                {
                    BLL.ShowMessage(this, "Course Schedule Name with this Name Already Exists");
                    return;
                }
                _obj_Smhr_CourseSchedule.OPERATION = operation.Insert;
                if (BLL.set_CourseSchedule(_obj_Smhr_CourseSchedule))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;



            case "BTN_UPDATE":
                _obj_Smhr_Room = new SMHR_TRAINING_ROOM();
                _obj_Smhr_Room.ORGANISATION_ID     = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_Room.ROOMID              = Convert.ToInt32(radTrainingRoom.SelectedValue);
                _obj_Smhr_Room.SMHR_COURSESCHEDULE = new SMHR_COURSESCHEDULE();
                _obj_Smhr_Room.SMHR_COURSESCHEDULE.COURSESCHEDULE_STARTDATE  = (DateTime)radStartdate.SelectedDate;
                _obj_Smhr_Room.SMHR_COURSESCHEDULE.COURSESCHEDULE_SATARTTIME = (DateTime)radStartTime.SelectedDate;
                _obj_Smhr_Room.OPERATION = operation.Select1;
                dtRooms = BLL.get_TrainingRooms(_obj_Smhr_Room);

                int roomStrength1 = Convert.ToInt32(dtRooms.Rows[0]["ROOMS_STRENGTH"]);
                if (Convert.ToInt32(radSeats.Text) > roomStrength1)
                {
                    BLL.ShowMessage(this, "Number of Seats should be less than or equal to " + Convert.ToString(roomStrength1));
                    return;
                }
                _obj_Smhr_CourseSchedule.COURSESCHEDULEID = Convert.ToInt32(lblCourseScheduleID.Text);
                if (Convert.ToBoolean(rad_IsActive.Checked) == false)
                {
                    SMHR_COURSESCHEDULE _obj_CourseSchedule = new SMHR_COURSESCHEDULE();
                    _obj_CourseSchedule.OPERATION        = operation.MODE;
                    _obj_CourseSchedule.COURSESCHEDULEID = Convert.ToInt32(lblCourseScheduleID.Text);


                    DataTable dt = BLL.get_CourseSchedule(_obj_CourseSchedule);

                    if (!Convert.ToBoolean(dt.Rows[0]["Status"]))
                    {
                        BLL.ShowMessage(this, "Cannot make inactive");
                        rad_IsActive.Checked = true;
                        return;
                    }
                }
                _obj_Smhr_CourseSchedule.OPERATION = operation.Update;

                if (BLL.set_CourseSchedule(_obj_Smhr_CourseSchedule))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                else
                {
                    BLL.ShowMessage(this, "Information Not Saved");
                }
                break;

            default:
                break;
            }
            Rm_Course_page.SelectedIndex = 0;
            LoadGrid();
            Rg_Course.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_CourseSchedule", ex.StackTrace, DateTime.Now);

            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #49
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("ESIC_71");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    //Rg_Countries.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    //btn_Save.Visible = false;
                    //btn_Update.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                RPT_ESIC71.ProcessingMode = Microsoft.Reporting.WebForms.ProcessingMode.Remote;
                Microsoft.Reporting.WebForms.ServerReport serverReport = default(Microsoft.Reporting.WebForms.ServerReport);
                serverReport = RPT_ESIC71.ServerReport;


                string    sDomain      = ConfigurationSettings.AppSettings["MyReportViewerDomain"];
                string    MyReportPath = System.Configuration.ConfigurationSettings.AppSettings["MyReportPath"];
                WebClient wc           = new WebClient();
                Reports.ReportServerNetworkCredentials _ObjNC = new Reports.ReportServerNetworkCredentials();
                serverReport.ReportServerCredentials = _ObjNC;
                serverReport.ReportServerUrl         = new Uri(sDomain);
                serverReport.ReportPath = MyReportPath + "ESIC-71";


                serverReport.Refresh();
                RPT_ESIC71.Visible = true;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "ESIC_71", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Page.Validate();
            if (!Page.IsPostBack)
            {
                //ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){ }", true);
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Payroll Results");//PAYROLLPROCESS");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    Rg_PayReults.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                LoadCombos();

                BLL.gridDateFormat(Convert.ToString(Session["EMP_ID"]), Rg_PayReults, "EMPDOJ");
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Payresults", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #51
0
        //function to comments based of topic
        public void GetAllTopicComments()
        {
            DataTable tab = new DataTable();
            BLL       obj = new BLL();

            try
            {
                tab.Rows.Clear();
                tab = obj.GetTopicComments(int.Parse(Request.QueryString["topicID"].ToString()));

                lblTopic.Text = "Topic Name : " + Request.QueryString["topicname"].ToString() + " [Number of Comments: " + tab.Rows.Count + "]";

                int serialNo = 1;

                if (tab.Rows.Count > 0)
                {
                    Table1.Rows.Clear();


                    for (int cnt = 0; cnt < tab.Rows.Count; cnt++)
                    {
                        TableRow row1 = new TableRow();
                        row1.Height = 30;

                        TableCell row1_cell1 = new TableCell();
                        row1_cell1.Font.Size = 10;
                        row1_cell1.Text      = cnt + serialNo + ".";
                        row1.Controls.Add(row1_cell1);

                        TableCell cell_comment = new TableCell();
                        cell_comment.Width = 650;
                        cell_comment.Text  = tab.Rows[cnt]["Comment"].ToString();
                        row1.Controls.Add(cell_comment);

                        TableRow row3 = new TableRow();
                        row3.Height = 30;

                        TableCell row3cell1 = new TableCell();
                        row3cell1.Text = " ";
                        row3.Controls.Add(row3cell1);

                        DataTable tab50 = new DataTable();
                        tab50.Rows.Clear();

                        tab50 = obj.GetCompanyById(tab.Rows[cnt]["CompanyId"].ToString());
                        TableCell row3cell2 = new TableCell();
                        row3cell2.Text = "Posted By : " + tab50.Rows[0]["CompanyName"].ToString() + " ," + "Posted Date : " + tab.Rows[cnt]["PostedDate"].ToString() + "<br/>";
                        row3.Controls.Add(row3cell2);

                        TableRow row10 = new TableRow();

                        TableCell row10_cell1 = new TableCell();
                        row10_cell1.ColumnSpan = 10;
                        row10_cell1.Width      = 660;
                        row10_cell1.Text       = "<hr/>";
                        row10.Controls.Add(row10_cell1);

                        Table1.Controls.Add(row1);
                        Table1.Controls.Add(row3);
                        Table1.Controls.Add(row10);
                    }
                }
                else
                {
                    Table1.Rows.Clear();
                    Table1.GridLines = GridLines.None;

                    TableRow row = new TableRow();

                    TableCell cell = new TableCell();
                    cell.ColumnSpan      = 10;
                    cell.ForeColor       = System.Drawing.Color.Red;
                    cell.Font.Bold       = true;
                    cell.Font.Size       = 14;
                    cell.Text            = "<b>No Topic related Comments Found</b>";
                    cell.HorizontalAlign = HorizontalAlign.Center;
                    row.Controls.Add(cell);
                    Table1.Controls.Add(row);
                }
            }
            catch
            {
                ClientScript.RegisterStartupScript(GetType(), "key", "<script>alert('Server Error - Check the Database Connectivity!!!')</script>");
            }
        }
Example #52
0
    protected void btn_Save_Click2(object sender, EventArgs e)
    {
        try
        {
            int cnt = 0;

            Label      lblModName;
            Label      lblModID;
            RadTextBox txt_AdminMail;
            RadTextBox txt_Mail;

            SMHR_Module_MailID _obj_smhr_Module_MailID = new SMHR_Module_MailID();

            for (int i = 0; i < RG_ModuleMailID.Items.Count; i++)
            {
                lblModName    = RG_ModuleMailID.Items[i].FindControl("lblModName") as Label;
                lblModID      = RG_ModuleMailID.Items[i].FindControl("lblModID") as Label;
                txt_AdminMail = RG_ModuleMailID.Items[i].FindControl("txt_AdminMail") as RadTextBox;
                txt_Mail      = RG_ModuleMailID.Items[i].FindControl("txt_Mail") as RadTextBox;

                if (txt_AdminMail.Text == string.Empty || txt_Mail.Text == string.Empty)
                {
                    BLL.ShowMessage(this, "Please Enter E-MailID for " + lblModName.Text);

                    if (txt_AdminMail.Text == string.Empty)
                    {
                        txt_AdminMail.Focus();
                    }
                    else
                    {
                        txt_Mail.Focus();
                    }

                    return;
                }

                bool isEmail1 = Regex.IsMatch(txt_AdminMail.Text.Trim(), @"\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z");
                bool isEmail2 = Regex.IsMatch(txt_Mail.Text.Trim(), @"\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z");

                if (isEmail1 == false)
                {
                    BLL.ShowMessage(this, "Invalid E-MailID for " + lblModName.Text);
                    txt_AdminMail.Focus();
                    return;
                }

                if (isEmail2 == false)
                {
                    BLL.ShowMessage(this, "Invalid E-MailID for " + lblModName.Text);
                    txt_Mail.Focus();
                    return;
                }

                if (lblModID.Text != string.Empty && lblModName.Text != string.Empty && (txt_AdminMail.Text != string.Empty || txt_Mail.Text != string.Empty))
                {
                    _obj_smhr_Module_MailID.Module_MailID_ModuleID     = Convert.ToInt32(lblModID.Text);
                    _obj_smhr_Module_MailID.Module_MailID_AdminEMailID = txt_AdminMail.Text;
                    _obj_smhr_Module_MailID.Module_MailID_EmailIDS     = txt_Mail.Text;
                    _obj_smhr_Module_MailID.ORGANISATION_ID            = Convert.ToInt32(Session["ORG_ID"]);
                    _obj_smhr_Module_MailID.CREATEDBY = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_Module_MailID.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]);

                    if (BLL.setEmailConfgMailIds(_obj_smhr_Module_MailID))
                    {
                        cnt++;
                    }
                }
            }

            if (cnt > 0)
            {
                BLL.ShowMessage(this, "Information Saved Successfully");
            }
            else
            {
                BLL.ShowMessage(this, "Information Not Saved");
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Module", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #53
0
 private void GridViewbind()
 {
     GridView1.DataSource = BLL.X7_CF_SeleteByNum(30);
     GridView1.DataBind();
 }
Example #54
0
    protected void btn_Save_Click1(object sender, EventArgs e)
    {
        try
        {
            const string emailpattern = @"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*";
            string       pattern      = @"^[a-z][a-z|0-9|]*([_][a-z|0-9]+)*([.][a-z|0-9]+([_][a-z|0-9]+)*)?@[a-z][a-z|0-9|]*\.([a-z][a-z|0-9]*(\.[a-z][a-z|0-9]*)?)$";


            Label      lblModName;
            RadTextBox txt_AdminMail, txt_Mail;

            for (int i = 0; i < RG_ModuleMailID.Items.Count; i++)
            {
                lblModName    = RG_ModuleMailID.Items[i].FindControl("lblModName") as Label;
                txt_AdminMail = RG_ModuleMailID.Items[i].FindControl("txt_AdminMail") as RadTextBox;
                txt_Mail      = RG_ModuleMailID.Items[i].FindControl("txt_Mail") as RadTextBox;

                if (txt_AdminMail.Text == string.Empty || txt_Mail.Text == string.Empty)
                {
                    BLL.ShowMessage(this, "Please Enter E-MailID for " + lblModName.Text);

                    if (txt_AdminMail.Text == string.Empty)
                    {
                        txt_AdminMail.Focus();
                    }
                    else
                    {
                        txt_Mail.Focus();
                    }

                    return;
                }

                bool isEmail1 = Regex.IsMatch(txt_AdminMail.Text.Trim(), @"\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z");
                bool isEmail2 = Regex.IsMatch(txt_Mail.Text.Trim(), @"\A(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)\Z");

                if (isEmail1 == false)
                {
                    BLL.ShowMessage(this, "Invalid E-MailID for " + lblModName.Text);
                    txt_AdminMail.Focus();
                    return;
                }
                if (isEmail2 == false)
                {
                    BLL.ShowMessage(this, "Invalid E-MailID for " + lblModName.Text);
                    txt_Mail.Focus();
                    return;
                }
            }

            _obj_smhr_Module_MailID = new SMHR_Module_MailID();
            DataTable  dt = CreateGridDataTable();
            RadTextBox rnEmailID;
            RadTextBox rtxtAdminMail;
            foreach (GridDataItem g in RG_ModuleMailID.Items)
            {
                rnEmailID = new RadTextBox();
                rnEmailID = g.FindControl("txt_Mail") as RadTextBox;

                rtxtAdminMail = new RadTextBox();
                rtxtAdminMail = g.FindControl("txt_AdminMail") as RadTextBox;

                string[] strEmailIDs      = rnEmailID.Text.Split(';');
                string[] strAdminEmailIDs = rtxtAdminMail.Text.Split(';');

                /*foreach (string s in strEmailIDs)
                 * {
                 *  if (!string.IsNullOrEmpty(s) && !isValidEmail(s))
                 *  {
                 *      BLL.ShowMessage(this, "Please enter valid emailid for " + g.Cells[3].Text);
                 *      return;
                 *  }
                 * }
                 * foreach (string s in strAdminEmailIDs)
                 * {
                 *  if (!string.IsNullOrEmpty(s) && !isValidEmail(s))
                 *  {
                 *      BLL.ShowMessage(this, "Please enter valid emailid for " + g.Cells[2].Text);
                 *      return;
                 *  }
                 * }
                 * foreach (string s in strAdminEmailIDs)
                 * {
                 *  if (!string.IsNullOrEmpty(s))
                 *  {
                 *      BLL.ShowMessage(this, "Please Enter E-mailid");
                 *  }
                 * }*/

                //TextBox txt = RG_ModuleMailID.FindControl("txt_AdminMail") as TextBox;
                //if (txt.Text == null || txt.Text == "")
                //{
                //    BLL.ShowMessage(this, "Please Enter E-mailid");
                //}
                dt.Rows.Add(Convert.ToInt32(g.Cells[2].Text), rnEmailID.Text, rtxtAdminMail.Text);
            }
            _obj_smhr_Module_MailID.MODULEMAILIDS   = dt;
            _obj_smhr_Module_MailID.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            _obj_smhr_Module_MailID.CREATEDBY       = Convert.ToInt32(Session["USER_ID"]);
            _obj_smhr_Module_MailID.CREATEDDATE     = DateTime.Now;
            _obj_smhr_Module_MailID.LASTMDFBY       = Convert.ToInt32(Session["USER_ID"]);
            _obj_smhr_Module_MailID.LASTMDFDATE     = DateTime.Now;
            _obj_smhr_Module_MailID.OPERATION       = operation.Insert;
            if (BLL.set_MailID(_obj_smhr_Module_MailID))
            {
                BLL.ShowMessage(this, "Information Saved Successfully");
            }
            else
            {
                BLL.ShowMessage(this, "Information Not Saved");
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Module", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #55
0
 private void UserControlVehicle_Load(object sender, EventArgs e)
 {
     BLL bll = new BLL();
 }
Example #56
0
    protected void btn_Submit_Click(object sender, EventArgs e)
    {
        try
        {
            DataTable dtCheckExists = new DataTable();
            bool      status        = false;
            int       mode          = 0;

            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_SUBMIT":

                if (rcmb_BusinessUnit.SelectedIndex <= 0)
                {
                    BLL.ShowMessage(this, "Please Select BusinessUnit");
                    return;
                }
                else if ((rcmb_Emp1.SelectedIndex == 0) || (rcmb_Emp3.SelectedIndex == 0))       // || (rcmb_Emp1.SelectedIndex == 0))
                {
                    if (rcmb_Emp1.SelectedIndex == 0)
                    {
                        BLL.ShowMessage(this, "Please Select Directorate General");
                        rcmb_Emp1.Focus();
                    }
                    //else if (rcmb_Emp1.SelectedIndex == 0)
                    //{
                    //    BLL.ShowMessage(this, "Please Select Employee 2");
                    //    rcmb_Emp2.Focus();
                    //}
                    else
                    {
                        BLL.ShowMessage(this, "Please Select Clerk Senate");
                        rcmb_Emp3.Focus();
                    }
                }

                _obj_pms_approval_process.OPERATION = operation.Insert;
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_EMP_ID_1 = (string.IsNullOrEmpty(rcmb_Emp1.SelectedValue) ? 0 : Convert.ToInt32(rcmb_Emp1.SelectedValue));
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_EMP_ID_2 = (string.IsNullOrEmpty(rcmb_Emp2.SelectedValue) ? 0 : Convert.ToInt32(rcmb_Emp2.SelectedValue));
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_EMP_ID_3 = (string.IsNullOrEmpty(rcmb_Emp3.SelectedValue) ? 0 : Convert.ToInt32(rcmb_Emp3.SelectedValue));
                _obj_pms_approval_process.BUID                        = Convert.ToInt32(rcmb_BusinessUnit.SelectedValue);
                _obj_pms_approval_process.ORGANISATION_ID             = Convert.ToInt32(Session["ORG_ID"]);
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_STATUS = true;
                //_obj_pms_approval_process.CREATEDBY = Convert.ToInt32(Session["EMP_ID"]);
                _obj_pms_approval_process.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                _obj_pms_approval_process.CREATEDDATE = DateTime.Now;

                dtCheckExists = BLL.Check_PMS_Approval_Process_Exists(_obj_pms_approval_process);

                if (Convert.ToInt32(dtCheckExists.Rows[0]["COUNT"]) == 0)
                {
                    status = BLL.set_PMS_APPROVAL_PROCESS(_obj_pms_approval_process);
                    if (status == true)
                    {
                        BLL.ShowMessage(this, "Information Saved Successfully");
                    }
                }
                else
                {
                    //BLL.ShowMessage(this, "This Approval Process Already Exists");
                    BLL.ShowMessage(this, "An Active Record for Approver Process Already Exists");
                    return;
                }
                break;

            case "BTN_UPDATE":

                _obj_pms_approval_process.OPERATION = operation.Update;
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_ID     = Convert.ToInt32(ViewState["appPrcsID"]);
                _obj_pms_approval_process.PMS_APPROVAL_PROCESS_STATUS = Convert.ToBoolean(ChkStatus.Checked);
                // _obj_pms_approval_process.LASTMDFBY = Convert.ToInt32(Session["EMP_ID"]);
                _obj_pms_approval_process.CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                _obj_pms_approval_process.LASTMDFDATE = DateTime.Now;

                if (ChkStatus.Checked)
                //mode = 1;
                {
                    dtCheckExists = BLL.Check_PMS_Approval_Process_Update_Exists(Convert.ToInt32(Session["ORG_ID"]), Convert.ToInt32(rcmb_BusinessUnit.SelectedValue));       //, mode

                    if (Convert.ToInt32(dtCheckExists.Rows[0]["COUNT"]) == 0)
                    {
                        status = BLL.set_PMS_APPROVAL_PROCESS(_obj_pms_approval_process);
                        if (status == true)
                        {
                            BLL.ShowMessage(this, "Information Updated Successfully");
                        }
                    }
                    else
                    {
                        //BLL.ShowMessage(this, "This Approval Process Already Exists");
                        BLL.ShowMessage(this, "An Active Record for Approver Process Already Exists");
                        Rm_ApprovalProcess_page.SelectedIndex = 0;
                        return;
                    }
                }
                else
                {
                    status = BLL.set_PMS_APPROVAL_PROCESS(_obj_pms_approval_process);
                    if (status == true)
                    {
                        BLL.ShowMessage(this, "Information Updated Successfully");
                    }
                }
                break;
            }

            LoadAppProcessGrid();
            Rg_ApprovalProcess.DataBind();
            Rm_ApprovalProcess_page.SelectedIndex = 0;
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_ApproverProcess", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            if (rcmb_FromPeriod.SelectedIndex <= 0)
            {
                BLL.ShowMessage(this, "Please Select Financial Period");
                return;
            }

            RadNumericTextBox rntbDependent;
            RadNumericTextBox rntbEligible;

            Label lblGradeID;
            int   count = 0;

            for (int i = 0; i < RG_Allowance.Items.Count; i++)
            {
                rntbDependent = RG_Allowance.Items[i].FindControl("rntbDependent") as RadNumericTextBox;
                rntbEligible  = RG_Allowance.Items[i].FindControl("rntbEligible") as RadNumericTextBox;

                if (rntbDependent.Text != string.Empty || rntbEligible.Text != string.Empty)
                {
                    if ((rntbDependent.Text == string.Empty && rntbEligible.Text != string.Empty) || (rntbDependent.Text != string.Empty && rntbEligible.Text == string.Empty))
                    {
                        if (rntbDependent.Text == string.Empty && rntbEligible.Text != string.Empty)
                        {
                            BLL.ShowMessage(this, "Please Enter Dependent value for S.NO: " + (i + 1).ToString());
                            rntbDependent.Focus();
                            return;
                        }
                        else
                        {
                            BLL.ShowMessage(this, "Please Enter Eligible value for S.NO: " + (i + 1).ToString());
                            rntbEligible.Focus();
                            return;
                        }
                    }
                }
                if (rntbDependent.Text == string.Empty || rntbEligible.Text == string.Empty)
                {
                    count++;
                }
            }

            if (count == RG_Allowance.Items.Count)
            {
                BLL.ShowMessage(this, "No records have any entered values..");
                return;
            }

            string    errorMsg    = string.Empty;
            DataTable dtallowance = GetAllowance(out errorMsg);

            if (!string.IsNullOrEmpty(errorMsg))
            {
                BLL.ShowMessage(this, errorMsg);
                return;
            }

            SMHR_ALLOWANCE _obj_Alwnce = new SMHR_ALLOWANCE();

            if (payItemID > 0)
            {
                _obj_Alwnce.COMMITTEE_ID        = payItemID;
                _obj_Alwnce.ORGANISATION_ID     = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Alwnce.ALLOWANCE_PERIOD_ID = Convert.ToInt32(rcmb_FromPeriod.SelectedValue);
                _obj_Alwnce.ALLOWANCE_CONFG_ID  = valID;
                _obj_Alwnce.CREATEDBY           = _obj_Alwnce.LASTMDFBY = Convert.ToInt32(Session["USER_ID"]);
                _obj_Alwnce.OPERATION           = operation.Insert1;

                for (int i = 0; i < RG_Allowance.Items.Count; i++)
                {
                    rntbDependent = RG_Allowance.Items[i].FindControl("rntbDependent") as RadNumericTextBox;
                    rntbEligible  = RG_Allowance.Items[i].FindControl("rntbEligible") as RadNumericTextBox;
                    lblGradeID    = RG_Allowance.Items[i].FindControl("lblGradeID") as Label;

                    if (lblGradeID.Text != string.Empty && rntbDependent.Text != string.Empty && rntbEligible.Text != string.Empty)
                    {
                        _obj_Alwnce.ALLOWANCE_EMPLOYEEGRADE_ID = Convert.ToInt32(lblGradeID.Text);
                        _obj_Alwnce.ALLOWANCE_DEPENDENT        = Convert.ToDecimal(rntbDependent.Text);
                        _obj_Alwnce.ALLOWANCE_ELIGIBLE         = Convert.ToInt32(rntbEligible.Text);

                        BLL.Set_Allowance_New(_obj_Alwnce);
                    }
                }
            }

            BLL.ShowMessage(this, "Record(s) saved successfully..!");
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "Allowance", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #58
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            Page.Validate();
            if (!Page.IsPostBack)
            {
                //code for security privilage
                Session.Remove("WRITEFACILITY");

                SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();

                _obj_Smhr_LoginInfo.OPERATION       = operation.Empty1;
                _obj_Smhr_LoginInfo.LOGIN_USERNAME  = Convert.ToString(Session["USERNAME"]).Trim();
                _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("Employee PF");
                DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                if (dtformdtls.Rows.Count != 0)
                {
                    if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true))
                    {
                        Session["WRITEFACILITY"] = 1;//WHICH MEANS READ AND WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 2;//WHICH MEANS READ NO WRITE
                    }
                    else if ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == false) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false))
                    {
                        Session["WRITEFACILITY"] = 3;//WHICH MEANS NO READ AND NO WRITE
                    }
                }
                else
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }


                if (Convert.ToInt32(Session["WRITEFACILITY"]) == 2)
                {
                    //Rg_Countries.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
                    //btn_Save.Visible = false;
                    //btn_Update.Visible = false;
                }
                else if (Convert.ToInt32(Session["WRITEFACILITY"]) == 3)
                {
                    smhr_UNAUTHORIZED _obj_smhr_unauthorized = new smhr_UNAUTHORIZED();
                    _obj_smhr_unauthorized.UNAUTHORIZED_USERID     = Convert.ToInt32(Session["USER_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_FORMID     = Convert.ToInt32(ViewState["FORMS_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_MODULEID   = Convert.ToInt32(ViewState["MODULE_ID"]);
                    _obj_smhr_unauthorized.UNAUTHORIZED_ACCESSDATE = Convert.ToDateTime(DateTime.Now.ToString());
                    SMHR.BLL.UnAuthorized_Log(_obj_smhr_unauthorized);
                    Response.Redirect("~/frm_UnAuthorized.aspx", false);
                }
                LoadBusinessUnit();
                LoadPeriod();
                //LoadPeriodElements();
                LoadOrganisation();
                rcmb_Organisation.Enabled = false;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "EmployeePF", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
Example #59
0
 private void GridViewbind()
 {
     GridView1.DataSource = BLL.CJDLT_HZHeng_SeleteByNum(30);
     GridView1.DataBind();
 }
 private void GridViewbind()
 {
     this.GridView1.DataSource = BLL.TC22X5_WeiHaoCF_SeleteByNum(30);
     this.GridView1.DataBind();
 }