public override void ImportToDatabase() { DataTable dataTable = GetImportDataFromTempDatabase(null); if (dataTable.Rows.Count > 0) { EDoublePayAdjustmentImportBatch batchDetail = new EDoublePayAdjustmentImportBatch(); batchDetail.DoublePayAdjustImportBatchDateTime = AppUtils.ServerDateTime(); //batchDetail.DoublePayAdjustImportBatchOriginalFilename = OriginalBatchFilename; batchDetail.DoublePayAdjustImportBatchRemark = Remark; batchDetail.DoublePayAdjustImportBatchUploadedBy = m_UserID; EDoublePayAdjustmentImportBatch.db.insert(dbConn, batchDetail); foreach (DataRow row in dataTable.Rows) { EUploadDoublePayAdjustment obj = new EUploadDoublePayAdjustment(); EUploadDoublePayAdjustment.db.toObject(row, obj); EDoublePayAdjustment DoublePayAdjust = new EDoublePayAdjustment(); DoublePayAdjust.SalesAchievementRate = obj.SalesAchievementRate; DoublePayAdjust.DoublePayAdjustEffDate = obj.DoublePayAdjustEffDate; DoublePayAdjust.EmpID = obj.EmpID; DoublePayAdjust.DoublePayAdjustImportBatchID = batchDetail.DoublePayAdjustImportBatchID; EDoublePayAdjustment.db.insert(dbConn, DoublePayAdjust); EUploadDoublePayAdjustment.db.delete(dbConn, obj); } } }
protected void Repeater_ItemDataBound(object sender, DataListItemEventArgs e) { EDoublePayAdjustment obj = new EDoublePayAdjustment(); db.toObject(((DataRowView)e.Item.DataItem).Row, obj); Hashtable values = new Hashtable(); db.populate(obj, values); { //((Button)e.Item.FindControl("Edit")).Visible = IsAllowEdit; //if (obj.PayRecID != null) //{ // ((Button)e.Item.FindControl("Edit")).Visible = false; // ((CheckBox)e.Item.FindControl("DeleteItem")).Visible = false; //} HtmlInputHidden h = (HtmlInputHidden)e.Item.FindControl("DoublePayAdjustID"); h.Value = obj.DoublePayAdjustID.ToString(); Label SalesAchievementRate = (Label)e.Item.FindControl("SalesAchievementRate"); Label DoublePayAdjustEffDate = (Label)e.Item.FindControl("DoublePayAdjustEffDate"); Binding ebinding = new Binding(dbConn, db); ebinding.add(SalesAchievementRate); ebinding.add(DoublePayAdjustEffDate); // ebinding.add(new BlankZeroLabelVLBinder(EEmpBankAccount.db, EmpAccID, "EmpAccID", EEmpBankAccount.VLBankAccount).setTextDisplayForZero(HROne.Common.WebUtility.GetLocalizedString(EEmpBankAccount.DEFAULT_BANK_ACCOUNT_TEXT))); ebinding.init(Request, Session); ebinding.toControl(values); DBFilter empRankFilter = new DBFilter(); empRankFilter.add(WebUtils.AddRankFilter(Session, "EmpID", true)); empRankFilter.add(new Match("EmpID", obj.EmpID)); if (EEmpPersonalInfo.db.count(dbConn, empRankFilter) > 0) { SalesAchievementRate.Text = obj.SalesAchievementRate.ToString("#0.00"); if (!obj.DoublePayAdjustEffDate.Ticks.Equals(0)) { DoublePayAdjustEffDate.Text = obj.DoublePayAdjustEffDate.ToString("yyyy-MM-dd"); } } else { SalesAchievementRate.Text = "******"; DoublePayAdjustEffDate.Text = "******"; } } }