예제 #1
0
    public DataView loadData(ListInfo info, DBManager db, DataList repeater)
    {
        //filter.add(new Match("EmpPayrollID",EmpPayrollID.Value));

        ImportEmpPersonalInfoProcess empImport = new ImportEmpPersonalInfoProcess(dbConn, Session.SessionID);
        DataTable table = empImport.GetImportDataFromTempDatabase(info);

        if (info != null)
        {
            if (!string.IsNullOrEmpty(info.orderby))
            {
                if (info.orderby.Equals("EmpEngFullName", StringComparison.CurrentCultureIgnoreCase))
                {
                    if (!table.Columns.Contains("EmpEngFullName"))
                    {
                        table.Columns.Add("EmpEngFullName", typeof(string));
                        foreach (System.Data.DataRow row in table.Rows)
                        {
                            EUploadEmpPersonalInfo empInfo = new EUploadEmpPersonalInfo();
                            empInfo.UploadEmpID = (int)row["UploadEmpID"];
                            if (EUploadEmpPersonalInfo.db.select(dbConn, empInfo))
                            {
                                row["EmpEngFullName"] = empInfo.EmpEngFullName;
                            }
                        }
                    }
                }
            }
        }
        table = WebUtils.DataTableSortingAndPaging(table, info);

        view = new DataView(table);
        if (repeater != null)
        {
            repeater.DataSource = view;
            repeater.DataBind();
        }
        if (table.Rows.Count > 0)
        {
            ImportSection.Visible = true;
        }
        else
        {
            ImportSection.Visible = false;
        }

        return(view);
    }
예제 #2
0
    protected void Repeater_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        EUploadEmpPersonalInfo obj = new EUploadEmpPersonalInfo();

        db.toObject(((DataRowView)e.Item.DataItem).Row, obj);

        if (e.Item.ItemIndex == Repeater.EditItemIndex)
        {
            //ebinding = new Binding(dbConn, db);
            //ebinding.add((TextBox)e.Item.FindControl("CNDEffDate"));
            //ebinding.add((HtmlInputHidden)e.Item.FindControl("CNDID"));
            //ebinding.add(new DropDownVLBinder(db, (DropDownList)e.Item.FindControl("PayCodeID"), EPaymentCode.VLPaymentCode));
            //ebinding.add(new DropDownVLBinder(db, (DropDownList)e.Item.FindControl("CurrencyID"), Values.VLCurrency));
            //ebinding.add((TextBox)e.Item.FindControl("CNDAmount"));
            //ebinding.add(new DropDownVLBinder(db, (DropDownList)e.Item.FindControl("CNDPayMethod"), Values.VLPaymentMethod));
            //ebinding.add((TextBox)e.Item.FindControl("CNDRemark"));

            //DBFilter filter = new DBFilter();
            //filter.add(new Match("EmpID", obj.EmpID));
            //ebinding.add(new DropDownVLBinder(db, (DropDownList)e.Item.FindControl("EmpAccID"), EEmpBankAccount.VLBankAccount, filter));



            //ebinding.init(Request, Session);

            //Hashtable values = new Hashtable();
            //db.populate(obj, values);

            //ebinding.toControl(values);
        }
        else
        {
            //((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("UploadEmpID");
            h.Value = ((DataRowView)e.Item.DataItem)["UploadEmpID"].ToString();
        }
    }