Ejemplo n.º 1
0
    void btnOK_Click(object sender, EventArgs e)
    {
        int ygCharge = 0;

        if (!int.TryParse(GetStringEditorValue(YouthChargeStd), out ygCharge))
        {
            ygCharge = 3;
        }

        if (Request["Action"] == "Import" && !ValidateFormField())
        {
            return;
        }

        //--如果是员工新增界面
        if (String.IsNullOrEmpty(txtOID.Value))
        {
            txtOID.Value = Guid.NewGuid().ToString();

            mmAdapter.MyInsert(txtOID.Value, GetStringEditorValue(EmpName), GetStringEditorValue(HrCode), GetStringEditorValue(Sex), GetStringEditorValue(Dept), GetStringEditorValue(WorkGroup), GetStringEditorValue(Post), GetStringEditorValue(ParttimeName),
                               GetStringEditorValue(Politics), GetDateTimeEditorValue(PartyDate), GetStringEditorValue(Wedding), GetStringEditorValue(Nation), GetStringEditorValue(NativePlace), GetStringEditorValue(Mobile), GetStringEditorValue(EmpID), GetStringEditorValue(House),
                               GetDateTimeEditorValue(Birthday), GetDateTimeEditorValue(JobDateTime), GetDateTimeEditorValue(ComDateTime), GetStringEditorValue(FstSchoolExp), GetStringEditorValue(FstDegree), GetStringEditorValue(LstSchoolExp), GetStringEditorValue(LstDegree),
                               GetStringEditorValue(SkillLevel), GetStringEditorValue(VolunteerInfo), GetStringEditorValue(SpecialSkill), GetStringEditorValue(ApplyParty), GetDateTimeEditorValue(ApplyPartyDate), GetStringEditorValue(FstSchool),
                               GetStringEditorValue(FstProfession), GetDateTimeEditorValue(FstGraduateDate), GetStringEditorValue(LstSchool), GetStringEditorValue(LstProfession), GetDateTimeEditorValue(LstGraduateDate), GetStringEditorValue(HrType),
                               GetStringEditorValue(HrStatus), ygCharge, GetStringEditorValue(FK_YouthGroup_FZ), GetStringEditorValue(Email), GetStringEditorValue(FK_YouthGroup));

            if (Request["Action"] == "Import")
            {
                miAdapter.MyDelete(Request["MI_OID"]);
            }

            NotificationTableAdapter.ClearNfCache();
        }
        else
        {
            mmAdapter.MyUpdate(GetStringEditorValue(EmpName), GetStringEditorValue(HrCode), GetStringEditorValue(Sex), GetStringEditorValue(Dept), GetStringEditorValue(WorkGroup), GetStringEditorValue(Post), GetStringEditorValue(ParttimeName),
                               GetStringEditorValue(Politics), GetDateTimeEditorValue(PartyDate), GetStringEditorValue(Wedding), GetStringEditorValue(Nation), GetStringEditorValue(NativePlace), GetStringEditorValue(Mobile), GetStringEditorValue(EmpID), GetStringEditorValue(House),
                               GetDateTimeEditorValue(Birthday), GetDateTimeEditorValue(JobDateTime), GetDateTimeEditorValue(ComDateTime), GetStringEditorValue(FstSchoolExp), GetStringEditorValue(FstDegree), GetStringEditorValue(LstSchoolExp), GetStringEditorValue(LstDegree),
                               GetStringEditorValue(SkillLevel), GetStringEditorValue(VolunteerInfo), GetStringEditorValue(SpecialSkill), GetStringEditorValue(ApplyParty), GetDateTimeEditorValue(ApplyPartyDate), GetStringEditorValue(FstSchool),
                               GetStringEditorValue(FstProfession), GetDateTimeEditorValue(FstGraduateDate), GetStringEditorValue(LstSchool), GetStringEditorValue(LstProfession), GetDateTimeEditorValue(LstGraduateDate), GetStringEditorValue(HrType),
                               GetStringEditorValue(HrStatus), ygCharge, GetStringEditorValue(Email), GetStringEditorValue(FK_YouthGroup), GetStringEditorValue(FK_YouthGroup_FZ), txtOID.Value);

            NotificationTableAdapter.ClearNfCache();
        }
    }